summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-06 16:28:38 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-07 14:35:41 +0200
commit1ae3c1a8405b96bc02a8d816dba07beb77fffc52 (patch)
tree57b14032b41d32e243ac1ce3e35690200a3ab58b /ogcp/views.py
parent7737a502ab98da6abb76c8332f133089eb482008 (diff)
views: exclude 00unknown and 10 from boot mode list
Ignore '00unknown', '10' from the list of boot modes in the form shown in action/mode.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index f910626..11ff7b5 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -1766,6 +1766,8 @@ def action_mode():
'memtest': 'Memory Test (memtest)',
}
+ excluded_modes = ['00unknown', '10']
+
most_used_mode = max(modes_set, key=lambda m: len(modes_set[m]))
available_modes = []
if most_used_mode in r.json()['modes']:
@@ -1773,7 +1775,7 @@ def action_mode():
available_modes.append(most_used_t)
for mode in r.json()['modes']:
- if mode != most_used_mode:
+ if mode != most_used_mode and mode not in excluded_modes:
available_modes.append((mode, mode_descriptions.get(mode, mode)))
if not available_modes: