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.
master
Alejandro Sirgo Rica 2024-06-13 15:58:43 +02:00
parent 509d0e8dcf
commit c0440eba51
1 changed files with 3 additions and 3 deletions

View File

@ -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)