mirror of https://git.48k.eu/ogcp
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.master
parent
ad41a0dfbe
commit
4a70bc174c
|
@ -112,8 +112,7 @@ class ClientDetailsForm(FlaskForm):
|
|||
choices=[('eth0', 'eth0'),
|
||||
('eth1', 'eth1'),
|
||||
('eth2', 'eth2')])
|
||||
repo = SelectField(label=_l('Repository'),
|
||||
choices=[(1, 'Default')])
|
||||
repo = SelectField(label=_l('Repository'))
|
||||
room = SelectField(label=_l('Room'))
|
||||
boot = SelectField(label=_l('Boot Mode'))
|
||||
create = SubmitField(label=_l('Create'))
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue