mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
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.
This commit is contained in:
@@ -5,12 +5,14 @@ from app.notify_client.models import InvitedUser
|
||||
|
||||
class InviteApiClient(NotifyAdminAPIClient):
|
||||
def __init__(self):
|
||||
super().__init__("a", "b", "c")
|
||||
super().__init__("a" * 73, "b")
|
||||
|
||||
def init_app(self, app):
|
||||
self.base_url = app.config['API_HOST_NAME']
|
||||
self.service_id = app.config['ADMIN_CLIENT_USER_NAME']
|
||||
self.api_key = app.config['ADMIN_CLIENT_SECRET']
|
||||
self.api_key = '{}-{}'.format(
|
||||
app.config['ADMIN_CLIENT_USER_NAME'],
|
||||
app.config['ADMIN_CLIENT_SECRET'],
|
||||
)
|
||||
|
||||
def create_invite(self, invite_from_id, service_id, email_address, permissions):
|
||||
data = {
|
||||
|
||||
Reference in New Issue
Block a user