summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2023-11-29 10:06:40 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2023-11-29 10:43:02 +0100
commit4a70bc174c6cf73bf21f0bd72ac54c4a6da4d0bb (patch)
tree589398a0e3ed46bb9d47ec6030d59d11524873b9 /ogcp/views.py
parentad41a0dfbeaa5b07ea454050af837de2d42d4bcd (diff)
views: populate repositories in client form
Make, in add and edit clients forms, the field repository show the list with the actual repositories, not a harcoded value.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 551012f..53487a1 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -918,6 +918,9 @@ def action_client_update():
form.room.choices = list(rooms)
form.room.render_kw = {'readonly': True}
+ repositories = get_repositories(server)
+ form.repo.choices = [(repo["id"], repo["name"]) for repo in repositories]
+
form.create.render_kw = {"formaction": url_for('action_client_update')}
return render_template('actions/client_details.html', form=form,
parent="scopes.html", scopes=scopes)
@@ -968,6 +971,9 @@ def action_client_add():
form.room.choices = list(rooms)
form.room.render_kw = {'readonly': True}
+ repositories = get_repositories(server)
+ form.repo.choices = [(repo["id"], repo["name"]) for repo in repositories]
+
form.create.render_kw = {"formaction": url_for('action_client_add')}
scopes, clients = get_scopes()
return render_template('actions/client_details.html', form=form,