Added a check that the call is not using a test api key.

Removed the tests for trial mode service for the scheduled tasks and the process job.
Having the validation in the POST notification and create job endpoint is enough.
Updated the test_service_whitelist test because the order of the array is not gaurenteed.
This commit is contained in:
Rebecca Law
2017-09-04 17:24:41 +01:00
parent d391919677
commit 19f964a90b
9 changed files with 34 additions and 129 deletions

View File

@@ -75,13 +75,6 @@ def process_job(job_id):
db_template = dao_get_template_by_id(job.template_id, job.template_version)
if db_template.template_type == LETTER_TYPE and job.service.restricted:
job.job_status = JOB_STATUS_ERROR
dao_update_job(job)
current_app.logger.warn(
"Job {} has been set to error, service {} is in trial mode".format(job_id, service.id))
return
TemplateClass = get_template_class(db_template.template_type)
template = TemplateClass(db_template.__dict__)
@@ -97,9 +90,7 @@ def process_job(job_id):
update_job_to_sent_to_dvla.apply_async([str(job.id)], queue=QueueNames.RESEARCH_MODE)
else:
build_dvla_file.apply_async([str(job.id)], queue=QueueNames.JOBS)
# temporary logging
current_app.logger.info("send job {} to build-dvla-file in the {} queue".format(
job_id, QueueNames.JOBS))
current_app.logger.info("send job {} to build-dvla-file in the {} queue".format(job_id, QueueNames.JOBS))
else:
job.job_status = JOB_STATUS_FINISHED