mirror of https://git.48k.eu/ogcp
views: process view after selection validation
Access selection values after selection validation to prevent the access of null values. Prevent backtrace with no sidebar elements selected.master v1.1.3-38
parent
ea9310f97a
commit
159f4c56a5
|
@ -1040,10 +1040,11 @@ def action_image_restore():
|
|||
return redirect(url_for('commands'))
|
||||
else:
|
||||
params = request.args.to_dict()
|
||||
center_id = int(params.get('scope-center'))
|
||||
ips = parse_elements(params)
|
||||
if not validate_elements(ips):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
center_id = int(params.get('scope-center'))
|
||||
form.ips.data = ' '.join(ips)
|
||||
|
||||
server = get_server_from_clients(ips)
|
||||
|
@ -1142,10 +1143,10 @@ def action_hardware():
|
|||
return redirect(url_for('commands'))
|
||||
else:
|
||||
ips = parse_elements(request.args.to_dict())
|
||||
scopes, _clients = get_scopes(ips)
|
||||
if not validate_elements(ips, max_len=1):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
scopes, _clients = get_scopes(ips)
|
||||
form.ips.data = ' '.join(ips)
|
||||
server = get_server_from_clients(ips)
|
||||
r = server.get('/hardware', payload={'client': list(ips)})
|
||||
|
@ -1182,10 +1183,10 @@ def action_software():
|
|||
return redirect(url_for('commands'))
|
||||
else:
|
||||
ips = parse_elements(request.args.to_dict())
|
||||
scopes, clients = get_scopes(set(ips))
|
||||
if not validate_elements(ips, max_len=1):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
scopes, clients = get_scopes(set(ips))
|
||||
form.ips.data = ' '.join(ips)
|
||||
server = get_server_from_clients(ips)
|
||||
r = server.get('/client/setup', payload={'client': list(ips)})
|
||||
|
@ -1389,11 +1390,11 @@ def action_image_fetch():
|
|||
else:
|
||||
params = request.args.to_dict()
|
||||
ips = parse_elements(params)
|
||||
center_id = int(params.get('scope-center'))
|
||||
|
||||
if not validate_elements(ips):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
center_id = int(params.get('scope-center'))
|
||||
ips_list = list(ips)
|
||||
form.ips.data = ' '.join(ips_list)
|
||||
|
||||
|
@ -2174,10 +2175,10 @@ def action_mode():
|
|||
|
||||
else:
|
||||
ips = parse_elements(request.args.to_dict())
|
||||
form.ips.data = " ".join(ips)
|
||||
if not validate_elements(ips):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
form.ips.data = " ".join(ips)
|
||||
server = get_server_from_clients(ips)
|
||||
modes_set = get_clients_modes(ips, server)
|
||||
r = server.get('/mode')
|
||||
|
@ -2243,10 +2244,10 @@ def action_oglive():
|
|||
|
||||
else:
|
||||
ips = parse_elements(request.args.to_dict())
|
||||
form.ips.data = " ".join(ips)
|
||||
if not validate_elements(ips):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
form.ips.data = " ".join(ips)
|
||||
server = get_server_from_clients(list(ips))
|
||||
|
||||
oglives_set = get_client_list_by_key(ips, server, key='livedir')
|
||||
|
@ -2311,10 +2312,10 @@ def action_repo_set():
|
|||
|
||||
else:
|
||||
ips = parse_elements(request.args.to_dict())
|
||||
form.ips.data = " ".join(ips)
|
||||
if not validate_elements(ips):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
form.ips.data = " ".join(ips)
|
||||
server = get_server_from_clients(list(ips))
|
||||
repositories = get_repositories(server)
|
||||
repos_set = get_clients_repo_dictionary(ips, server, repositories)
|
||||
|
@ -2443,10 +2444,11 @@ def action_image_update():
|
|||
return redirect(url_for('commands'))
|
||||
|
||||
params = request.args.to_dict()
|
||||
center_id = int(params.get('scope-center'))
|
||||
ips = parse_elements(params)
|
||||
if not validate_elements(ips, max_len=1):
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
center_id = int(params.get('scope-center'))
|
||||
form.ip.data = ' '.join(ips)
|
||||
|
||||
server = get_server_from_clients(ips)
|
||||
|
|
Loading…
Reference in New Issue