Disallow spaces in attachment slugs

This commit is contained in:
2018-04-03 12:24:42 +02:00
parent 14b31174dc
commit a86920fc73
2 changed files with 2 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ _file_embedded_schema = {
} }
} }
ATTACHMENT_SLUG_REGEX = '[a-zA-Z0-9_ ]+' ATTACHMENT_SLUG_REGEX = '[a-zA-Z0-9_]+'
attachments_embedded_schema = { attachments_embedded_schema = {
'type': 'dict', 'type': 'dict',

View File

@@ -867,6 +867,7 @@ def upgrade_attachment_usage(proj_url=None, all_projects=False, go=False):
if status != 200: if status != 200:
log.error('Error %i storing altered node %s %s', status, node['_id'], r) log.error('Error %i storing altered node %s %s', status, node['_id'], r)
raise SystemExit('Error storing node; see log.') raise SystemExit('Error storing node; see log.')
log.debug('Updated node %s: %s', node['_id'], r)
log.info('Project %s (%s) has %d nodes with attachments', log.info('Project %s (%s) has %d nodes with attachments',
proj_url, proj_id, node_count) proj_url, proj_id, node_count)