Commit Graph

414 Commits

Author SHA1 Message Date
Chris Hill-Scott
68eaacaafb Accept and validate personalisation
This commit allows the send notification endpoint to accept an extra parameter,
`personalisation`, the contents of which will be used (later) to replace the
placeholders in the template.

It does validation in the following places:
- at the schema level, to validate the type and (optional) presence of
  personalisation
- at the endpoint, to check whether the personalisation provided matches exactly
  the placeholders in the template

It does not do validation when processing CSV files, as these are assumed to
already have been validated by the admin app.

It explicitly does not persist either the names of the placeholders (these
should always be derived from the template contents unless it really becomes a
performance concern) or the values of the placeholders (because they might be
personal data).
2016-03-02 08:59:34 +00:00
Chris Hill-Scott
68f31c6f84 Refactor send notification into one route
Using a URL parameter means that sending a notification can be done in one
route, rather than two separate routes and an extra method.

This commit also refactors that one remaining method to be shorter/cleaner/more
readable (or I think so anyway).

No functional changes in this commit.
2016-03-02 08:59:34 +00:00
Rebecca Law
a2b1dc0432 Merge pull request #115 from alphagov/accept-invite
[WIP] Start of api for accepting invite.
2016-03-01 15:57:52 +00:00
Adam Shimali
ac9adc292b [WIP] Change status code to 404 rather than 400. 2016-03-01 15:51:22 +00:00
Adam Shimali
993bdc8055 [WIP] use correct dao function for adding user to service.
Check for no user returned from user dao and return correct
error message.
2016-03-01 15:36:31 +00:00
Adam Shimali
9fe08d480c Merge pull request #114 from alphagov/cancel-invited-user
New endpoint to update invited user.
2016-03-01 15:17:03 +00:00
Rebecca Law
dd503e7f14 Merge pull request #113 from alphagov/fetch-notifications-endpoints
Fetch endpoints for notifications
2016-03-01 15:16:54 +00:00
Rebecca Law
ecc96bfd68 Merge pull request #111 from alphagov/add_manage_team
Fixed some tests.
2016-03-01 15:02:08 +00:00
Martyn Inglis
dd67b84f6d Merge branch 'fetch-notifications-endpoints' of github.com:alphagov/notifications-api into fetch-notifications-endpoints
Conflicts:
	app/dao/notifications_dao.py
2016-03-01 14:59:21 +00:00
Martyn Inglis
6d345c1dfc Fixed ordering of the notifications test
- was backwards
2016-03-01 14:58:27 +00:00
minglis
57d8aa2bfd Removed print statement 2016-03-01 14:38:54 +00:00
Nicholas Staples
a2f021efad Fix git review. 2016-03-01 14:22:46 +00:00
Adam Shimali
3b66745677 [WIP] Start of api for accepting invite. 2016-03-01 14:13:38 +00:00
Rebecca Law
98c9ba14f7 New endpoint to update invited user.
Can be used to update status on invited user.
2016-03-01 13:33:20 +00:00
Martyn Inglis
c5a993ead1 Fetch endpoints for notifications
- includes check on token type to ensure clients can perform admin style fetches
2016-03-01 13:30:10 +00:00
Nicholas Staples
7d43b4265f Merge and fix conflicts. 2016-03-01 11:59:50 +00:00
Nicholas Staples
22f550dd34 Add missing file. 2016-03-01 11:45:54 +00:00
NIcholas Staples
4e678ac391 Merge pull request #112 from alphagov/permission-fix
Fix bug in PermissionDAO
2016-03-01 11:44:16 +00:00
Rebecca Law
ecbfbbc6b0 Fix bug in PermissionDAO
Refactor user/test_rest
Remove conftest/sample_admin_service
2016-03-01 10:34:27 +00:00
Nicholas Staples
47ac0b8a98 Fixed some tests. 2016-02-29 18:32:25 +00:00
Adam Shimali
5aa2243e81 Merge pull request #110 from alphagov/invitation
Email invitation to user
2016-02-29 16:25:04 +00:00
Rebecca Law
6f338f17ac Merge branch 'master' into invitation
Conflicts:
	scripts/run_celery.sh
2016-02-29 16:14:35 +00:00
Rebecca Law
9f6255ac94 Add subject line to the invitation email. 2016-02-29 16:12:12 +00:00
Rebecca Law
3879350c12 Send email invitation to invited user 2016-02-29 15:56:00 +00:00
minglis
4b068b9c18 Merge pull request #108 from alphagov/add_template_permission
Manage template permission added. All tests passing.
2016-02-29 15:32:40 +00:00
Nicholas Staples
8ad13b6356 Manage template permission added. All tests passing. 2016-02-29 15:21:35 +00:00
minglis
bf4417c05f Merge pull request #107 from alphagov/permissions-on-invite
Permissions on invite
2016-02-29 14:59:59 +00:00
Adam Shimali
59aec1939c [WIP] invited user now has comma separated permission values
stored against it so that user can be created with correct
permissions.
2016-02-29 14:05:02 +00:00
Adam Shimali
6f786143c8 Merge pull request #105 from alphagov/create_permissions_on_service_creation
Create permissions on service creation
2016-02-29 14:00:32 +00:00
Nicholas Staples
873f31cad0 Merge remote-tracking branch 'origin/master' into create_permissions_on_service_creation 2016-02-29 13:48:38 +00:00
Adam Shimali
faa55672cb Merge pull request #104 from alphagov/add_user_permissions
Add user permissions
2016-02-29 13:44:30 +00:00
Rebecca Law
df278a8e6e Email invitation to an invited user.
New celery task to send the email.
2016-02-29 13:21:12 +00:00
Nicholas Staples
fa77d7d83e Add default permissions for existing services. 2016-02-29 12:59:38 +00:00
Nicholas Staples
0f9bdc4cd9 Merge remote-tracking branch 'origin/master' into create_permissions_on_service_creation 2016-02-29 11:51:47 +00:00
Nicholas Staples
2cf2b51cd9 Fix for git commit review. 2016-02-29 11:50:43 +00:00
Adam Shimali
df61e0366e Merge pull request #103 from alphagov/add_service_permission
Working permissions and all tests passing.
2016-02-29 11:27:44 +00:00
Nicholas Staples
9b73b0d9f8 Default permissions added on service creation. All tests working. 2016-02-26 17:11:30 +00:00
Nicholas Staples
75b9f77f92 user permissions now returned with the user object and all tests passing. 2016-02-26 15:57:24 +00:00
Nicholas Staples
16e1ecb134 Working permissions and all tests passing.
Remove print statements.

Fix for review comments.
2016-02-26 15:00:29 +00:00
Martyn Inglis
5bbd3aad39 Reorder sql files 2016-02-25 16:02:36 +00:00
Martyn Inglis
1be003cffb Moved missing migtations to end of run 2016-02-25 15:58:01 +00:00
Adam Shimali
abb46e0a9f Merge pull request #100 from alphagov/service-not-found-returns-404
Fix get_users_by_service to return 404 if service does not exist.
2016-02-25 15:47:11 +00:00
Rebecca Law
52ab17e718 Fix duplicate name 2016-02-25 15:35:31 +00:00
Rebecca Law
ff6cad1acf Merge branch 'master' into service-not-found-returns-404
Conflicts:
	app/errors.py
2016-02-25 15:33:53 +00:00
Adam Shimali
ab495d983e Merge pull request #99 from alphagov/celery-jobs
Celery jobs
2016-02-25 15:30:29 +00:00
Rebecca Law
0f333de2cc Merge branch 'master' into service-not-found-returns-404 2016-02-25 15:16:56 +00:00
Rebecca Law
42f2065920 Migration file to add unique constraint on user_to_service. 2016-02-25 15:16:00 +00:00
Martyn Inglis
b213c3fa3c Merge branch 'master' into celery-jobs
Conflicts:
	tests/app/conftest.py
2016-02-25 15:10:39 +00:00
Rebecca Law
8bcaf7741d Merge pull request #98 from alphagov/invite-user-2
[WIP] added dao and rest endpoint for retrieving invited users
2016-02-25 14:00:27 +00:00
Adam Shimali
3b11cfc8e5 Fix for intermittent failure 2016-02-25 12:27:42 +00:00