enforce allow_dashes_in_svc at module creation

This commit is contained in:
Mike McLean
2021-05-05 22:35:15 -04:00
parent 1f37c646f7
commit 76e30dd8ad

View File

@@ -710,6 +710,15 @@ def submit_module_build(db_session, username, stream_or_packager, params, module
module.context = mmd.get_context()
module.context += context_suffix
if not conf.allow_dashes_in_svc:
if '-' in module.stream:
raise ValidationError('Dashes not allowed in stream')
if '-' in module.version:
raise ValidationError('Dashes not allowed in version')
if '-' in module.context:
raise ValidationError('Dashes not allowed in context')
db_session.commit()
notify_on_module_state_change(