views: validate client partitions in /action/software

Redirect the user when /action/software is accessed on a client
without valid partitions.
master
Alejandro Sirgo Rica 2025-02-13 14:57:23 +01:00
parent 1cf6fbc49e
commit 35269b31a7
1 changed files with 5 additions and 0 deletions

View File

@ -1199,6 +1199,11 @@ def action_software():
f"| {PART_TYPE_CODES.get(part.get('code'), 'UNKNOWN')} "
f"{FS_CODES.get(part.get('filesystem'), 'UNKNOWN')}")
)
if not form.os.choices:
flash(_(f'No valid partition available'), category='error')
return redirect(url_for('commands'))
return render_template('actions/software.html', form=form, scopes=scopes)
@app.route('/action/session', methods=['GET', 'POST'])