From 764502059563659a4a430de5e699f37d10d9325c Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Fri, 19 Jan 2024 13:31:39 +0100 Subject: views: Add checking that no folder is selected 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 --- ogcp/views.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ogcp') 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 -- cgit v1.2.3-18-g5258