Commit Graph

11 Commits

Author SHA1 Message Date
Rebecca Law
6b09075779 Fix poorly written sentence 2019-11-22 11:02:22 +00:00
Rebecca Law
5d6886242b Check that the request payload data is valid json.
By adding `force=True` to request.get_json() the mime type is ignore. If the data is not valid json the method will return a `BadRequestError` we catch that and throw our own error with a clear error message "Invalid JSON supplied in POST data".
If the json is valid return the json data or an empty dict if None is passed in.

This PR improves the error messages if the json is invalid, previously, the error message was "None object type" message which is not very helpful.
2019-11-21 15:23:11 +00:00
Leo Hemsted
c78a5d8536 Merge pull request #2662 from alphagov/utils-bump
Utils bump
2019-11-21 15:23:11 +00:00
Martyn Inglis
0e38259cb4 Remove all DAO get service calls, replaced with reference to new service object in context. 2017-05-05 15:23:06 +01:00
Ken Tsang
ccd25382ea Refactored post template 2017-04-11 16:37:30 +01:00
Ken Tsang
7c0aeca66e Removed unused imports 2017-04-11 16:19:43 +01:00
Ken Tsang
06ec7a59a6 Refactored code to personalise subject 2017-04-11 16:19:43 +01:00
Ken Tsang
eba88b08c5 Removed URI from preview response 2017-04-11 16:19:43 +01:00
Ken Tsang
22239deb90 Removed redundant try block 2017-03-22 14:01:04 +00:00
Ken Tsang
8e5266e89b Refactor and fix auth errors 2017-03-22 10:54:15 +00:00
Ken Tsang
b81d789307 Add preview endpoint and tests 2017-03-22 10:11:31 +00:00