summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ogcp/views.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index fe3902b..131686c 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -1683,12 +1683,17 @@ def action_image_create():
if r.status_code != requests.codes.ok:
return ogserver_error('commands')
+ image_name = form.name.data.strip()
+ if ' ' in image_name:
+ flash(_('No spaces allowed in image names'), category='error')
+ return redirect(url_for('commands'))
+
disk, partition, code = form.os.data.split(' ')
payload = {"clients": [ip],
"disk": disk,
"partition": partition,
"code": code,
- "name": form.name.data,
+ "name": image_name,
"repository_id": int(form.repository.data),
"id": "0", # This is ignored by the server.
"description": form.description.data,