summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2024-02-01 11:39:20 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-02-01 12:01:32 +0100
commita41ad5eec6cefe540cbb5c4a5454c0c4ae24bf1c (patch)
tree00ccfbee6b6907e561a8c5080078b267acdb6350 /ogcp
parent85a22b9b8137a26869494c8b908c03321dc47846 (diff)
views: Fix client-info form not fully read-only1.1.3-14
fix some fields (boot-mode and oglive) in client-info form that, despite being flagged as read-only, allowed the user to change values.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index dd16e79..c2be721 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -994,7 +994,7 @@ def action_client_info():
form.mac.render_kw = {'readonly': True}
form.serial_number.data = db_client['serial_number']
form.serial_number.render_kw = {'readonly': True}
- form.livedir.data = db_client['livedir']
+ form.livedir.choices = [(db_client['livedir'], db_client['livedir'])]
form.livedir.render_kw = {'readonly': True}
form.remote.data = db_client['remote']
form.remote.render_kw = {'readonly': True}
@@ -1011,29 +1011,9 @@ def action_client_info():
form.repo.render_kw = {'readonly': True}
form.room.data = db_client['room']
form.room.render_kw = {'readonly': True}
- form.boot.data = db_client['boot']
+ form.boot.choices = [(db_client['boot'], db_client['boot'])]
form.boot.render_kw = {'readonly': True}
- r = server.get('/oglive/list')
- if not r:
- return ogserver_down('commands')
- if r.status_code != requests.codes.ok:
- return ogserver_error('commands')
-
- available_oglives = r.json()['oglive']
- for oglive in available_oglives:
- choice = (oglive.get('directory'), oglive.get('directory'))
- form.livedir.choices.append(choice)
-
- r = server.get('/mode')
- if not r:
- return ogserver_down('commands')
- if r.status_code != requests.codes.ok:
- return ogserver_error('commands')
-
- available_modes = [(mode, mode) for mode in r.json()['modes']]
- form.boot.choices = list(available_modes)
-
r = server.get('/scopes')
if not r:
return ogserver_down('commands')