From fa5e5475e95ff76913d466020ac3e7ea65e4d576 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 8 Sep 2016 15:55:07 +0100 Subject: [PATCH 1/3] 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. --- app/notify_client/api_key_api_client.py | 10 +++++----- app/notify_client/events_api_client.py | 10 +++++----- app/notify_client/invite_api_client.py | 10 +++++----- app/notify_client/job_api_client.py | 10 +++++----- app/notify_client/notification_api_client.py | 10 +++++----- app/notify_client/organisations_client.py | 10 +++++----- app/notify_client/provider_client.py | 10 +++++----- app/notify_client/service_api_client.py | 6 +++--- app/notify_client/status_api_client.py | 10 +++++----- app/notify_client/template_statistics_api_client.py | 10 +++++----- app/notify_client/user_api_client.py | 10 +++++----- requirements.txt | 2 +- 12 files changed, 54 insertions(+), 54 deletions(-) diff --git a/app/notify_client/api_key_api_client.py b/app/notify_client/api_key_api_client.py index ade506c38..a42ec633e 100644 --- a/app/notify_client/api_key_api_client.py +++ b/app/notify_client/api_key_api_client.py @@ -9,15 +9,15 @@ KEY_TYPE_TEST = 'test' class ApiKeyApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def get_api_keys(self, service_id, key_id=None): if key_id: diff --git a/app/notify_client/events_api_client.py b/app/notify_client/events_api_client.py index af487419a..2a043ebc6 100644 --- a/app/notify_client/events_api_client.py +++ b/app/notify_client/events_api_client.py @@ -2,15 +2,15 @@ from notifications_python_client.base import BaseAPIClient class EventsApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def create_event(self, event_type, event_data): data = { diff --git a/app/notify_client/invite_api_client.py b/app/notify_client/invite_api_client.py index 0ac65acb8..47f495d54 100644 --- a/app/notify_client/invite_api_client.py +++ b/app/notify_client/invite_api_client.py @@ -6,15 +6,15 @@ from app.notify_client.models import InvitedUser class InviteApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def create_invite(self, invite_from_id, service_id, email_address, permissions): data = { diff --git a/app/notify_client/job_api_client.py b/app/notify_client/job_api_client.py index c7811a50f..68d754a4f 100644 --- a/app/notify_client/job_api_client.py +++ b/app/notify_client/job_api_client.py @@ -5,15 +5,15 @@ from app.notify_client import _attach_current_user class JobApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] @staticmethod def __convert_statistics(job): diff --git a/app/notify_client/notification_api_client.py b/app/notify_client/notification_api_client.py index 3fc6c18a1..3b42f10e3 100644 --- a/app/notify_client/notification_api_client.py +++ b/app/notify_client/notification_api_client.py @@ -2,15 +2,15 @@ from notifications_python_client.base import BaseAPIClient class NotificationApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def get_all_notifications(self, page=None): params = {} diff --git a/app/notify_client/organisations_client.py b/app/notify_client/organisations_client.py index 21a4ae36e..dbd075852 100644 --- a/app/notify_client/organisations_client.py +++ b/app/notify_client/organisations_client.py @@ -3,17 +3,17 @@ from notifications_python_client.base import BaseAPIClient class OrganisationsClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__( base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret' + service_id=service_id or 'service_id', + api_key=api_key or 'api_key' ) def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def get_organisation(self, id): return self.get(url='/organisation/{}'.format(id)) diff --git a/app/notify_client/provider_client.py b/app/notify_client/provider_client.py index b2f07a5c9..09e9bae8c 100644 --- a/app/notify_client/provider_client.py +++ b/app/notify_client/provider_client.py @@ -3,17 +3,17 @@ from app.notify_client import _attach_current_user class ProviderClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__( base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret' + service_id=service_id or 'service_id', + api_key=api_key or 'api_key' ) def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def get_all_providers(self): return self.get( diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index db837e53c..4da0a6872 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -11,12 +11,12 @@ class ServiceAPIClient(NotificationsAPIClient): def __init__(self): super(ServiceAPIClient, self).__init__("api_url", "client", - "secret") + "api_key") def init_app(self, application): self.base_url = application.config['API_HOST_NAME'] - self.client_id = application.config['ADMIN_CLIENT_USER_NAME'] - self.secret = application.config['ADMIN_CLIENT_SECRET'] + self.service_id = application.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = application.config['ADMIN_CLIENT_SECRET'] def create_service(self, service_name, active, message_limit, restricted, user_id, email_from): """ diff --git a/app/notify_client/status_api_client.py b/app/notify_client/status_api_client.py index 601dec340..de2ff428e 100644 --- a/app/notify_client/status_api_client.py +++ b/app/notify_client/status_api_client.py @@ -2,15 +2,15 @@ from notifications_python_client.base import BaseAPIClient class StatusApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def get_status(self, *params): return self.get(url='/_status', *params) diff --git a/app/notify_client/template_statistics_api_client.py b/app/notify_client/template_statistics_api_client.py index 7829340d2..153854e34 100644 --- a/app/notify_client/template_statistics_api_client.py +++ b/app/notify_client/template_statistics_api_client.py @@ -2,15 +2,15 @@ from notifications_python_client.base import BaseAPIClient class TemplateStatisticsApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] def get_template_statistics_for_service(self, service_id, limit_days=None): params = {} diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index 8c43f2eeb..8b89f483f 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -5,15 +5,15 @@ from app.notify_client.models import User class UserApiClient(BaseAPIClient): - def __init__(self, base_url=None, client_id=None, secret=None): + def __init__(self, base_url=None, service_id=None, api_key=None): super(self.__class__, self).__init__(base_url=base_url or 'base_url', - client_id=client_id or 'client_id', - secret=secret or 'secret') + service_id=service_id or 'service_id', + api_key=api_key or 'api_key') def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] - self.client_id = app.config['ADMIN_CLIENT_USER_NAME'] - self.secret = app.config['ADMIN_CLIENT_SECRET'] + self.service_id = app.config['ADMIN_CLIENT_USER_NAME'] + self.api_key = app.config['ADMIN_CLIENT_SECRET'] self.max_failed_login_count = app.config["MAX_FAILED_LOGIN_COUNT"] def register_user(self, name, email_address, mobile_number, password): diff --git a/requirements.txt b/requirements.txt index 65c82049c..303196ab5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,6 +17,6 @@ pyexcel-xlsx==0.1.0 pyexcel-ods3==0.1.1 pytz==2016.4 -git+https://github.com/alphagov/notifications-python-client.git@1.0.0#egg=notifications-python-client==1.0.0 +git+https://github.com/alphagov/notifications-python-client.git@1.3.0#egg=notifications-python-client==1.3.0 git+https://github.com/alphagov/notifications-utils.git@9.0.0#egg=notifications-utils==9.0.0 From 5fda35c89d742a058b87418f7120f5688d1c53ac Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 12 Sep 2016 12:14:57 +0100 Subject: [PATCH 2/3] Make it clear that client do not use `__init__` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/notify_client/api_key_api_client.py | 6 ++---- app/notify_client/events_api_client.py | 6 ++---- app/notify_client/invite_api_client.py | 6 ++---- app/notify_client/job_api_client.py | 6 ++---- app/notify_client/notification_api_client.py | 6 ++---- app/notify_client/organisations_client.py | 8 ++------ app/notify_client/provider_client.py | 8 ++------ app/notify_client/service_api_client.py | 4 +--- app/notify_client/status_api_client.py | 6 ++---- app/notify_client/template_statistics_api_client.py | 6 ++---- app/notify_client/user_api_client.py | 6 ++---- 11 files changed, 21 insertions(+), 47 deletions(-) diff --git a/app/notify_client/api_key_api_client.py b/app/notify_client/api_key_api_client.py index a42ec633e..ba3d4e8e5 100644 --- a/app/notify_client/api_key_api_client.py +++ b/app/notify_client/api_key_api_client.py @@ -9,10 +9,8 @@ KEY_TYPE_TEST = 'test' class ApiKeyApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/events_api_client.py b/app/notify_client/events_api_client.py index 2a043ebc6..263b75ebf 100644 --- a/app/notify_client/events_api_client.py +++ b/app/notify_client/events_api_client.py @@ -2,10 +2,8 @@ from notifications_python_client.base import BaseAPIClient class EventsApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/invite_api_client.py b/app/notify_client/invite_api_client.py index 47f495d54..82d13f4c9 100644 --- a/app/notify_client/invite_api_client.py +++ b/app/notify_client/invite_api_client.py @@ -6,10 +6,8 @@ from app.notify_client.models import InvitedUser class InviteApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/job_api_client.py b/app/notify_client/job_api_client.py index 68d754a4f..3e239b9f3 100644 --- a/app/notify_client/job_api_client.py +++ b/app/notify_client/job_api_client.py @@ -5,10 +5,8 @@ from app.notify_client import _attach_current_user class JobApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/notification_api_client.py b/app/notify_client/notification_api_client.py index 3b42f10e3..c4a671b1e 100644 --- a/app/notify_client/notification_api_client.py +++ b/app/notify_client/notification_api_client.py @@ -2,10 +2,8 @@ from notifications_python_client.base import BaseAPIClient class NotificationApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/organisations_client.py b/app/notify_client/organisations_client.py index dbd075852..3c8bdddc0 100644 --- a/app/notify_client/organisations_client.py +++ b/app/notify_client/organisations_client.py @@ -3,12 +3,8 @@ from notifications_python_client.base import BaseAPIClient class OrganisationsClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__( - base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key' - ) + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/provider_client.py b/app/notify_client/provider_client.py index 09e9bae8c..6421f89c5 100644 --- a/app/notify_client/provider_client.py +++ b/app/notify_client/provider_client.py @@ -3,12 +3,8 @@ from app.notify_client import _attach_current_user class ProviderClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__( - base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key' - ) + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index 4da0a6872..99f5df982 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -9,9 +9,7 @@ class ServiceAPIClient(NotificationsAPIClient): # Fudge assert in the super __init__ so # we can set those variables later. def __init__(self): - super(ServiceAPIClient, self).__init__("api_url", - "client", - "api_key") + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, application): self.base_url = application.config['API_HOST_NAME'] diff --git a/app/notify_client/status_api_client.py b/app/notify_client/status_api_client.py index de2ff428e..79ee90004 100644 --- a/app/notify_client/status_api_client.py +++ b/app/notify_client/status_api_client.py @@ -2,10 +2,8 @@ from notifications_python_client.base import BaseAPIClient class StatusApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/template_statistics_api_client.py b/app/notify_client/template_statistics_api_client.py index 153854e34..2b58571e8 100644 --- a/app/notify_client/template_statistics_api_client.py +++ b/app/notify_client/template_statistics_api_client.py @@ -2,10 +2,8 @@ from notifications_python_client.base import BaseAPIClient class TemplateStatisticsApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index 8b89f483f..ad176d3b3 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -5,10 +5,8 @@ from app.notify_client.models import User class UserApiClient(BaseAPIClient): - def __init__(self, base_url=None, service_id=None, api_key=None): - super(self.__class__, self).__init__(base_url=base_url or 'base_url', - service_id=service_id or 'service_id', - api_key=api_key or 'api_key') + def __init__(self): + super(self.__class__, self).__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] From 92aacc1a549b6a5be52c0cd40fece2bc9599eaf2 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 12 Sep 2016 14:59:53 +0100 Subject: [PATCH 3/3] Remove extraneous arguments to super > dont need self.__class__, self in super - that's a python 2.x crutch. > super() is equivalent --- app/notify_client/api_key_api_client.py | 2 +- app/notify_client/events_api_client.py | 2 +- app/notify_client/invite_api_client.py | 2 +- app/notify_client/job_api_client.py | 2 +- app/notify_client/notification_api_client.py | 2 +- app/notify_client/organisations_client.py | 2 +- app/notify_client/provider_client.py | 2 +- app/notify_client/service_api_client.py | 2 +- app/notify_client/status_api_client.py | 2 +- app/notify_client/template_statistics_api_client.py | 2 +- app/notify_client/user_api_client.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/notify_client/api_key_api_client.py b/app/notify_client/api_key_api_client.py index ba3d4e8e5..914f409f4 100644 --- a/app/notify_client/api_key_api_client.py +++ b/app/notify_client/api_key_api_client.py @@ -10,7 +10,7 @@ KEY_TYPE_TEST = 'test' class ApiKeyApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/events_api_client.py b/app/notify_client/events_api_client.py index 263b75ebf..5aef8dae0 100644 --- a/app/notify_client/events_api_client.py +++ b/app/notify_client/events_api_client.py @@ -3,7 +3,7 @@ from notifications_python_client.base import BaseAPIClient class EventsApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/invite_api_client.py b/app/notify_client/invite_api_client.py index 82d13f4c9..5ead8a736 100644 --- a/app/notify_client/invite_api_client.py +++ b/app/notify_client/invite_api_client.py @@ -7,7 +7,7 @@ from app.notify_client.models import InvitedUser class InviteApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/job_api_client.py b/app/notify_client/job_api_client.py index 3e239b9f3..614a01560 100644 --- a/app/notify_client/job_api_client.py +++ b/app/notify_client/job_api_client.py @@ -6,7 +6,7 @@ from app.notify_client import _attach_current_user class JobApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/notification_api_client.py b/app/notify_client/notification_api_client.py index c4a671b1e..4e5bb88f7 100644 --- a/app/notify_client/notification_api_client.py +++ b/app/notify_client/notification_api_client.py @@ -3,7 +3,7 @@ from notifications_python_client.base import BaseAPIClient class NotificationApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/organisations_client.py b/app/notify_client/organisations_client.py index 3c8bdddc0..f58d075c4 100644 --- a/app/notify_client/organisations_client.py +++ b/app/notify_client/organisations_client.py @@ -4,7 +4,7 @@ from notifications_python_client.base import BaseAPIClient class OrganisationsClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/provider_client.py b/app/notify_client/provider_client.py index 6421f89c5..cd2614b2d 100644 --- a/app/notify_client/provider_client.py +++ b/app/notify_client/provider_client.py @@ -4,7 +4,7 @@ from app.notify_client import _attach_current_user class ProviderClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index 99f5df982..8886904f6 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -9,7 +9,7 @@ class ServiceAPIClient(NotificationsAPIClient): # Fudge assert in the super __init__ so # we can set those variables later. def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, application): self.base_url = application.config['API_HOST_NAME'] diff --git a/app/notify_client/status_api_client.py b/app/notify_client/status_api_client.py index 79ee90004..74d0471a4 100644 --- a/app/notify_client/status_api_client.py +++ b/app/notify_client/status_api_client.py @@ -3,7 +3,7 @@ from notifications_python_client.base import BaseAPIClient class StatusApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/template_statistics_api_client.py b/app/notify_client/template_statistics_api_client.py index 2b58571e8..4da1d87cb 100644 --- a/app/notify_client/template_statistics_api_client.py +++ b/app/notify_client/template_statistics_api_client.py @@ -3,7 +3,7 @@ from notifications_python_client.base import BaseAPIClient class TemplateStatisticsApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index ad176d3b3..e3c6cc1d6 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -6,7 +6,7 @@ from app.notify_client.models import User class UserApiClient(BaseAPIClient): def __init__(self): - super(self.__class__, self).__init__("a", "b", "c") + super().__init__("a", "b", "c") def init_app(self, app): self.base_url = app.config['API_HOST_NAME']