diff --git a/app/notify_client/api_key_api_client.py b/app/notify_client/api_key_api_client.py index 914f409f4..e8429b650 100644 --- a/app/notify_client/api_key_api_client.py +++ b/app/notify_client/api_key_api_client.py @@ -1,6 +1,4 @@ -from notifications_python_client.base import BaseAPIClient -from app.notify_client import _attach_current_user - +from app.notify_client import _attach_current_user, NotifyAdminAPIClient # must match key types in notifications-api/app/models.py KEY_TYPE_NORMAL = 'normal' @@ -8,7 +6,7 @@ KEY_TYPE_TEAM = 'team' KEY_TYPE_TEST = 'test' -class ApiKeyApiClient(BaseAPIClient): +class ApiKeyApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/events_api_client.py b/app/notify_client/events_api_client.py index 5aef8dae0..8c2e99539 100644 --- a/app/notify_client/events_api_client.py +++ b/app/notify_client/events_api_client.py @@ -1,7 +1,7 @@ -from notifications_python_client.base import BaseAPIClient +from app.notify_client import NotifyAdminAPIClient -class EventsApiClient(BaseAPIClient): +class EventsApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/invite_api_client.py b/app/notify_client/invite_api_client.py index 5ead8a736..4fca1e4e6 100644 --- a/app/notify_client/invite_api_client.py +++ b/app/notify_client/invite_api_client.py @@ -1,11 +1,9 @@ -from notifications_python_client.base import BaseAPIClient - -from app.notify_client import _attach_current_user +from app.notify_client import _attach_current_user, NotifyAdminAPIClient from app.notify_client.models import InvitedUser -class InviteApiClient(BaseAPIClient): +class InviteApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/job_api_client.py b/app/notify_client/job_api_client.py index 4ec07bc8f..7f45b3ac9 100644 --- a/app/notify_client/job_api_client.py +++ b/app/notify_client/job_api_client.py @@ -1,10 +1,9 @@ from collections import defaultdict -from notifications_python_client.base import BaseAPIClient -from app.notify_client import _attach_current_user +from app.notify_client import _attach_current_user, NotifyAdminAPIClient -class JobApiClient(BaseAPIClient): +class JobApiClient(NotifyAdminAPIClient): JOB_STATUSES = { 'scheduled', diff --git a/app/notify_client/notification_api_client.py b/app/notify_client/notification_api_client.py index 430932f12..0c3d018df 100644 --- a/app/notify_client/notification_api_client.py +++ b/app/notify_client/notification_api_client.py @@ -1,7 +1,7 @@ -from notifications_python_client.base import BaseAPIClient +from app.notify_client import NotifyAdminAPIClient -class NotificationApiClient(BaseAPIClient): +class NotificationApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/organisations_client.py b/app/notify_client/organisations_client.py index f58d075c4..58eb418f9 100644 --- a/app/notify_client/organisations_client.py +++ b/app/notify_client/organisations_client.py @@ -1,7 +1,7 @@ -from notifications_python_client.base import BaseAPIClient +from app.notify_client import NotifyAdminAPIClient -class OrganisationsClient(BaseAPIClient): +class OrganisationsClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/provider_client.py b/app/notify_client/provider_client.py index cd2614b2d..d40c0f4cb 100644 --- a/app/notify_client/provider_client.py +++ b/app/notify_client/provider_client.py @@ -1,8 +1,8 @@ -from notifications_python_client.base import BaseAPIClient -from app.notify_client import _attach_current_user + +from app.notify_client import _attach_current_user, NotifyAdminAPIClient -class ProviderClient(BaseAPIClient): +class ProviderClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/service_api_client.py b/app/notify_client/service_api_client.py index 379bbcb14..e974890db 100644 --- a/app/notify_client/service_api_client.py +++ b/app/notify_client/service_api_client.py @@ -1,11 +1,10 @@ from __future__ import unicode_literals from flask import url_for -from notifications_python_client.base import BaseAPIClient from app.utils import BrowsableItem -from app.notify_client import _attach_current_user +from app.notify_client import _attach_current_user, NotifyAdminAPIClient -class ServiceAPIClient(BaseAPIClient): +class ServiceAPIClient(NotifyAdminAPIClient): # Fudge assert in the super __init__ so # we can set those variables later. def __init__(self): diff --git a/app/notify_client/status_api_client.py b/app/notify_client/status_api_client.py index 74d0471a4..fc6c233c0 100644 --- a/app/notify_client/status_api_client.py +++ b/app/notify_client/status_api_client.py @@ -1,7 +1,8 @@ -from notifications_python_client.base import BaseAPIClient + +from app.notify_client import NotifyAdminAPIClient -class StatusApiClient(BaseAPIClient): +class StatusApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/template_statistics_api_client.py b/app/notify_client/template_statistics_api_client.py index 4da1d87cb..91dc7446c 100644 --- a/app/notify_client/template_statistics_api_client.py +++ b/app/notify_client/template_statistics_api_client.py @@ -1,7 +1,7 @@ -from notifications_python_client.base import BaseAPIClient +from app.notify_client import NotifyAdminAPIClient -class TemplateStatisticsApiClient(BaseAPIClient): +class TemplateStatisticsApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c") diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index c68a2e1e7..c1b129571 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -1,6 +1,6 @@ -from notifications_python_client.notifications import BaseAPIClient from notifications_python_client.errors import HTTPError +from app.notify_client import NotifyAdminAPIClient from app.notify_client.models import User ALLOWED_ATTRIBUTES = { @@ -10,7 +10,7 @@ ALLOWED_ATTRIBUTES = { } -class UserApiClient(BaseAPIClient): +class UserApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a", "b", "c")