Commit Graph

23 Commits

Author SHA1 Message Date
Rebecca Law
22fc4b693a The previous PR added a error handler for the wrong db exception.
This corrects it to look for the unique constraint.
2019-04-12 10:55:21 +01:00
Rebecca Law
f35960c3a3 Return a useful message if the domain is a duplicate. 2019-04-10 13:23:34 +01:00
Chris Hill-Scott
f62ed714f8 Add a method to guess organisation from a domain
We need this in the admin app while we still have pages that:
- talk about the data sharing and financial agreement
- but aren’t within a service (so can’t look at the service’s
  organisation)

This is a get, but it deliberately won’t work if you pass it an email
address, in order not to put personally identifying information in our
logs.
2019-04-04 10:13:19 +01:00
Leo Hemsted
efec57db01 replace user_schema with serialize method on user model
this is so that we can filter out inactive organisations and services

note: can't remove user schema completely, as we still use it in
POST /user to create new users
2018-03-14 15:39:31 +00:00
chrisw
a487293bf0 Add check org name is unique endpoint 2018-03-06 15:34:39 +00:00
Rebecca Law
70f9dfc0f6 Added more tests 2018-02-23 10:45:18 +00:00
Rebecca Law
13ef2d7bae - new endpoint to check the token for an org invitation.
- new endpoint to add user to organisation
- new endpoint to return users for an organisation
2018-02-23 10:45:18 +00:00
Rebecca Law
927f6e8335 Catch itegrity errors and return 400.
When creating or updating an organisation an itegrity error is raise if the name is already used.
This change adds a new error handler for the organisation to catch the named unique index and return a 400 with a sensible message.
We have an other error handler for unique service names which was caught in the error handler for all blueprints. A new error handler for the service_blueprint has been created for catch those specific unique constraints.
This is a nice way to encapulate the specific errors for a specific blueprint.
2018-02-19 14:33:44 +00:00
Rebecca Law
6f488bf7c7 Reduce logging level
If the organisation name that is being inserted or updated is not unique we just want to return a 400 to the admin app.
Updated the code so that we are not logging.exception, this is because a cloud watch alert is set to the support team. This type of error is not something we need to investigate.
2018-02-14 14:35:40 +00:00
Ken Tsang
4576bdd64f Reraise integrity errors on org name unique contraints as 400
- currently being raised as 500s, but should really be 400s as the request data has the duplicate name
2018-02-13 14:47:03 +00:00
Ken Tsang
d80c7d4f65 Return services serialized for dashboard for orgs
- rather than returning the entire service, return only whats needed when listing the service on the org dashboard
2018-02-13 14:06:43 +00:00
Ken Tsang
44f9143d08 Organisation services API endpoints 2018-02-13 14:06:43 +00:00
Katie Smith
4a14225d04 Change Organisation DAO update method
- Changed the organisation DAO update method to only make 1 query
- Updated the update rest endpoint to not return an organisation when
the update is successful
2018-02-09 11:17:13 +00:00
Katie Smith
269923ba28 Add Organisations endpoints
As part of this we also needed to add:
- schemas for validation
- serialize method for Organisation model
2018-02-08 15:22:21 +00:00
Leo Hemsted
2f79da8702 create, edit and use email branding instead of organisation
notable things that have been kept until migration is complete:

* passing in `organisation` to update_service will update email branding
* both `/email-branding` and `/organisation` hit the same code
* service endpoints still return organisation as well as email branding
2018-02-06 11:23:34 +00:00
Ken Tsang
0c77f2d010 Refactored dao_update_organisation 2017-07-12 12:01:50 +01:00
Ken Tsang
106d59006b Removed dao_update_organisation 2017-07-12 12:01:50 +01:00
Ken Tsang
af9091f207 Refactor tests to use admin_request 2017-07-12 12:01:50 +01:00
Ken Tsang
3b1f229384 Renamed migration script and refactor code 2017-07-12 12:01:50 +01:00
Ken Tsang
b814c5ff26 Refactor organisation rest to remove marshmallow 2017-07-12 12:01:50 +01:00
Ken Tsang
76493a209c Added POST for organisation rest 2017-07-12 12:01:50 +01:00
Ken Tsang
c743e52fe8 Add organisations model and create dao 2017-07-12 12:01:50 +01:00
Leo Hemsted
e631333a34 add GET /organisation and GET /organisation/id endpoints 2016-08-09 15:59:22 +01:00