summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 53487a1..fa458e3 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -897,7 +897,6 @@ def action_client_update():
db_client = r.json()
form.server.data = "{0}:{1}".format(server.ip, server.port)
- print("server ip:", form.server.data)
form.ip.data = db_client['ip']
form.ip.render_kw = {'readonly': True}
form.name.data = db_client['name']
@@ -907,7 +906,6 @@ def action_client_update():
form.remote.data = db_client['remote']
form.maintenance.data = db_client['maintenance']
form.netiface.data = db_client['netiface']
- form.repo.data = db_client['repo_id']
form.boot.render_kw = {'readonly': True}
r = server.get('/scopes')
@@ -919,7 +917,10 @@ def action_client_update():
form.room.render_kw = {'readonly': True}
repositories = get_repositories(server)
- form.repo.choices = [(repo["id"], repo["name"]) for repo in repositories]
+ form.repo.choices = [(repo["id"], repo["name"]) for repo in repositories
+ if db_client['repo_id'] == repo["id"]]
+ form.repo.choices.extend([(repo["id"], repo["name"]) for repo in repositories
+ if db_client['repo_id'] != repo["id"]])
form.create.render_kw = {"formaction": url_for('action_client_update')}
return render_template('actions/client_details.html', form=form,