mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 22:42:28 -05:00
Create job now checks that the service is active before creating job.
Need to check what message and status code we should use for this case. Probably will create a InactiveServiceRequest exception.
This commit is contained in:
@@ -203,7 +203,7 @@ class Test(Config):
|
||||
Queue('send-email', Exchange('default'), routing_key='send-email'),
|
||||
Queue('research-mode', Exchange('default'), routing_key='research-mode')
|
||||
]
|
||||
REDIS_ENABLED = True
|
||||
REDIS_ENABLED = False
|
||||
API_HOST_NAME = "http://localhost:6011"
|
||||
|
||||
|
||||
|
||||
@@ -110,7 +110,9 @@ def get_jobs_by_service(service_id):
|
||||
|
||||
@job.route('', methods=['POST'])
|
||||
def create_job(service_id):
|
||||
dao_fetch_service_by_id(service_id)
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
if not service.active:
|
||||
raise InvalidRequest("Unable to create job to inactive service", 400)
|
||||
|
||||
data = request.get_json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user