views: Fix traceback due to missing translation

Fix crash when adding a folder if no room or center is selected
because no translation is available.

plan is to update translations in a follow up patch.
master
Javier Hernandez 2024-01-22 11:11:51 +01:00 committed by OpenGnSys Support Team
parent 3b319a17a8
commit 4060b64612
1 changed files with 2 additions and 2 deletions

View File

@ -1090,10 +1090,10 @@ def action_folder_add():
room = params.get('scope-room')
center = params.get('scope-center')
if room and center:
flash(_('Please, select either a room or a center'), category='error')
flash(('Please, select either a room or a center'), category='error')
return redirect(url_for('scopes'))
if not room and not center:
flash(_('Please, select a room or a center'), category='error')
flash(('Please, select a room or a center'), category='error')
return redirect(url_for('scopes'))
if params.get('folder'):
flash(('Error: A folder has been selected. Please, select a room or a center'), category='error')