summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2024-01-19 13:31:39 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-01-19 13:34:24 +0100
commit764502059563659a4a430de5e699f37d10d9325c (patch)
treeef528b9b377f1dfabf49edf21bdf8b66c99348d4
parent3844a3a48abb7c6d1d7204a0a0131c82c87206b3 (diff)
views: Add checking that no folder is selected1.1.3-13
Check that, when adding a new folder there is no other folders checked. It is only allowed to add folders to either centers or rooms
-rw-r--r--ogcp/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index cb19c4b..2d7deac 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -1090,6 +1090,9 @@ def action_folder_add():
if not room and not center:
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')
+ return redirect(url_for('scopes'))
form.server.data = params['scope-server']
form.room.data = room
form.center.data = center