diff options
-rw-r--r-- | ogcp/views.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index c0b2c98..f560fa1 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1347,7 +1347,11 @@ def action_mode(): flash(_('Ogserver replied with status code not ok'), category='error') return redirect(url_for('commands')) - available_modes = [(mode, mode) for mode in r.json()['modes']] + most_used_mode = max(modes_set, key=lambda m: len(modes_set[m])) + available_modes = [] + if most_used_mode in r.json()['modes']: + available_modes.append((most_used_mode, most_used_mode)) + available_modes.extend([(mode, mode) for mode in r.json()['modes'] if mode != most_used_mode]) if not available_modes: flash(_('no boot templates are available in the server'), category='error') |