Commit Graph

18 Commits

Author SHA1 Message Date
Chris Hill-Scott
2c17825c12 Don’t use magic string for job status 2016-09-02 23:22:14 +01:00
Chris Hill-Scott
11a4b18451 Combine query filters when getting scheduled job
> filter_by and filter are just aliases for each other so can be
> combined together - filter is probably the better one (and then use
> == instead of keyword args)
2016-09-02 12:27:23 +01:00
Chris Hill-Scott
4a7267be8b Add an endpoint to cancel a job
If you schedule a job you might change your mind or circumstances might
change. So you need to be able to cancel it. This commit adds a `POST`
endpoint for individual jobs which sets their status to `cancelled`.

This also means adding a new status of `cancelled`, so there’s a
migration…
2016-09-02 12:27:02 +01:00
Martyn Inglis
8b9319ac7a Merge branch 'master' into scheduled-delivery-of-jobs
Conflicts:
	app/dao/jobs_dao.py
	tests/app/dao/test_jobs_dao.py
	tests/app/job/test_rest.py
2016-08-25 14:53:00 +01:00
Martyn Inglis
9af85d9cb3 new jobs query to get all scheduled jobs 2016-08-24 16:24:30 +01:00
Martyn Inglis
09cb94081b Returns the outcome statistics for the job on the API call. 2016-08-23 16:46:58 +01:00
Rebecca Law
a67793cf8a Updated date query so that the created_at date is truncated so that we get all jobs created number of days requested. 2016-05-25 11:13:49 +01:00
Rebecca Law
2a7872cce1 Add a limit days query param for get all jobs. 2016-05-24 17:21:04 +01:00
Martyn Inglis
beb6f7ca57 Order jobs by service
- newest first
2016-03-14 16:15:39 +00:00
Rebecca Law
123b0ead3a Replaced first queries with one queries, which throws a NoResultFound.
Able to remove many of the None checks as a result of this.
Fixed the tests were needed.
2016-03-11 15:34:20 +00:00
Rebecca Law
e055590b07 Changed db queries to use one, which throws NoResultFound exception, this exception is dealt with in our error handlers.
Now a lot of the if none checks can be removed.
2016-03-11 12:39:55 +00:00
Martyn Inglis
b3884e2d6c Move job processing into celery
- brings boto S3 into new AWS folder
- CSV processing utils method

Rejigs the jobs rest endpoint - removes some now unused endpoints,

Calls to the task with the job, job processing in task, delegating SMS calls to the sms task
2016-02-24 17:12:30 +00:00
Martyn Inglis
635debb5a6 Moved the sending sms for a job into celery tasks 2016-02-23 17:30:50 +00:00
Adam Shimali
e024db6858 As job update is a PUT then all non nullable fields
need to be sent with update.

Also bug in not committing update fixed.
2016-02-05 13:07:02 +00:00
Adam Shimali
bec4bbe04e Endpoint and dao method for updating job status. 2016-02-04 20:55:09 +00:00
Adam Shimali
f4a0a9b8d9 Fix for job urls that should have been within context of a service.
The service id path parameter is captured in the url prefix for the
job blueprint.
2016-01-18 09:57:04 +00:00
Adam Shimali
834801d19b Added endpoints for creating job, and getting job/jobs. 2016-01-15 15:48:05 +00:00
Adam Shimali
b9f6db1856 Added model and dao for Jobs. 2016-01-15 11:12:05 +00:00