diff options
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 1203ffd..2ca2681 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1095,7 +1095,8 @@ def action_client_add(): "remote": form.remote.data, "repo_id": int(form.repo.data), "room": int(form.room.data), - "serial_number": form.serial_number.data} + "serial_number": form.serial_number.data, + "folder_id": int(form.folder_id.data) } server = get_server_from_ip_port(form.server.data) r = server.post('/client/add', payload) @@ -1108,7 +1109,7 @@ def action_client_add(): else: params = request.args.to_dict() if not params.get('scope-room'): - flash(_('Please, select one room'), category='error') + flash(_('Please, select a room or a folder'), category='error') return redirect(url_for('scopes')) form.server.data = params['scope-server'] server = get_server_from_ip_port(params['scope-server']) @@ -1128,6 +1129,11 @@ def action_client_add(): repositories = get_repositories(server) form.repo.choices = [(repo["id"], repo["name"]) for repo in repositories] + if params.get('folder'): + form.folder_id.data = params['folder'] + else: + form.folder_id.data = 0 + form.submit.render_kw = {"formaction": url_for('action_client_add')} scopes, clients = get_scopes() return render_template('actions/client_details.html', form=form, |