diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-06-13 15:58:43 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-06-14 09:25:36 +0200 |
commit | c0440eba51b2ee0a4fe394dfbe54664b47a5b0b6 (patch) | |
tree | 3266d562af03d4f853f41ed5bf2278e5d366cf6b /ogcp/views.py | |
parent | 509d0e8dcf8df1627428c9e3431431d28b5b817d (diff) |
views: fix center/update validation with no selection
Check no center selection before missing server data.
Lack of checkbox selection will not carry server data as server
information is defined based on the components selected. Report
no center selection instead of lack server data in that case.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index ede1ed0..2f08c0f 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -2130,13 +2130,13 @@ def action_center_update(): params = request.args.to_dict() server = params.get('scope-server') center = params.get('scope-center') + if not center: + flash(_('Please, select one center'), category='error') + return redirect(url_for("scopes")) if not server: flash(_('Internal error: server was not sent as request argument'), category='error') return redirect(url_for("scopes")) - if not center: - flash(_('Please, select one center'), category='error') - return redirect(url_for("scopes")) server = get_server_from_ip_port(server) |