Skip to content
Snippets Groups Projects
Commit 802c53b9 authored by Nathaniel Kofalt's avatar Nathaniel Kofalt
Browse files

Prevent mixed plurality from getting into jobs code

parent 8dd87502
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,9 @@ FileInput = namedtuple('input', ['container_type', 'container_id', 'filename', '
# Convert a dictionary to a FileInput
def convert_to_fileinput(d):
if d['container_type'].endswith('s'):
raise Exception('Container type cannot be plural :|')
return FileInput(
container_type= d['container_type'],
container_id = d['container_id'],
......@@ -101,6 +104,9 @@ def queue_job(db, algorithm_id, input, attempt_n=1, previous_job_id=None):
if algorithm_id not in ALGORITHMS:
raise Exception('Usupported algorithm ' + algorithm_id)
if input.container_type.endswith('s'):
raise Exception('Container type cannot be plural :|')
# TODO validate container exists
now = datetime.datetime.utcnow()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment