From c0440eba51b2ee0a4fe394dfbe54664b47a5b0b6 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 13 Jun 2024 15:58:43 +0200 Subject: 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. --- ogcp/views.py | 6 +++--- 1 file 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) -- cgit v1.2.3-18-g5258