Commit Graph

19 Commits

Author SHA1 Message Date
Chris Hill-Scott
415e1a401a Don’t set combined API on Notify python client
Because we’re setting the API key and service ID after calling the
`__init__` method of the client it wasn’t doing the thing where it
splits the combined key into the two individual UUIDs. So we still need
to set them directly, individually on the client.
2017-07-26 12:08:10 +01:00
Chris Hill-Scott
5ddbe80ea9 Fix calls to API client which now takes fewer args
The Notify API client changed in version 4 to take two arguments, not
three (service ID was removed in favour of the combined API key).

This gets a bit gnarly because the API key has to be at least a certain
length so it can be substringed internally.
2017-07-26 11:10:37 +01:00
Martyn Inglis
08dc8fb13d Use the local APIClient rather than the one from the python-api-client
- ensures that all API calls set the request ID when talking to the API.
2016-11-30 17:01:44 +00:00
Chris Hill-Scott
92aacc1a54 Remove extraneous arguments to super
> dont need self.__class__, self in super - that's a python 2.x crutch.
> super() is equivalent
2016-09-12 14:59:53 +01:00
Chris Hill-Scott
5fda35c89d Make it clear that client do not use __init__
The clients never get passed useful values to their `__init__` methods.
Rather the real values are passed through later using the `init_app`
method.

So it should be an error if the client is relying on the values that
get passed to it’s init method. Easiest way to ensure this is by making
the `__init__` method not expect any arguments and passing fake values
to the `Super` call.
2016-09-12 12:18:19 +01:00
Chris Hill-Scott
fa5e5475e9 Update Python client
Just so that nobody else has to do it.

Implements:
- [x] https://github.com/alphagov/notifications-python-client/pull/29

Which is a breaking change requiring the renaming of method arguments.
2016-09-08 15:55:07 +01:00
Chris Hill-Scott
da1fa2e61c Make _attach_current_user a pure function
Mutating dictionaries is gross and doesn’t work as you’d expect. Better
to have the function return a new dictionary instead.

Means we can be explicit that `created_by` is one of the allowed params
when updating a service.
2016-08-11 17:07:55 +01:00
Rebecca Law
848db38573 Added missing import 2016-04-15 11:53:39 +01:00
Nicholas Staples
2085792742 Add created_by to all appropriate requests. 2016-04-15 11:08:19 +01:00
Adam Shimali
a974e6e157 [WIP] Add call to api to update invitation to accepted.
When flow for invited user is complete, that is
when user has been added to service, update invitation
to accepted
2016-03-03 18:13:56 +00:00
Rebecca Law
bfea4a42bc Merge branch 'master' into cancel-invited-user
Conflicts:
	app/notify_client/invite_api_client.py
	tests/app/main/views/test_manage_users.py
2016-03-01 18:01:20 +00:00
Rebecca Law
73e5fe2907 Change cancel_invited_user client to not return anything. 2016-03-01 17:56:39 +00:00
Rebecca Law
8e6bd2471d Change method to a get.
Fix path param in invite_api_client.cancel_invited_user
2016-03-01 17:00:01 +00:00
Rebecca Law
219c740071 Add button to cancel invitation of invited user. 2016-03-01 16:12:26 +00:00
Adam Shimali
5f3c72729e [WIP] Start of user accepting invite.
This commit only deals with acceptance by
users who are already in system.

Changed invite client to return invited user objects
instead of dictionaries.

Added commented out test. fixed up fixtures to return invited user
object for invites
2016-03-01 14:10:35 +00:00
Martyn Inglis
7b5e8061e2 Slight (bad) hack to ensure that the ticks appear on the manage user page
- changes imports for utils from broken version on previous branch
2016-03-01 10:45:13 +00:00
Adam Shimali
8c10c36f50 Invite user form now posts permissions string to api with
data to create invite.
2016-02-29 11:03:35 +00:00
Adam Shimali
c76717942f Manage user pages now surfaces invited users
fetched from api.
2016-02-26 15:34:12 +00:00
Adam Shimali
0de80bba97 [WIP] Invite user form now submits data to api. 2016-02-26 13:07:35 +00:00