mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-05 20:18:24 -04:00
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.
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
from notifications_python_client.base import BaseAPIClient
|
from app.notify_client import _attach_current_user, NotifyAdminAPIClient
|
||||||
from app.notify_client import _attach_current_user
|
|
||||||
|
|
||||||
|
|
||||||
# must match key types in notifications-api/app/models.py
|
# must match key types in notifications-api/app/models.py
|
||||||
KEY_TYPE_NORMAL = 'normal'
|
KEY_TYPE_NORMAL = 'normal'
|
||||||
@@ -8,7 +6,7 @@ KEY_TYPE_TEAM = 'team'
|
|||||||
KEY_TYPE_TEST = 'test'
|
KEY_TYPE_TEST = 'test'
|
||||||
|
|
||||||
|
|
||||||
class ApiKeyApiClient(BaseAPIClient):
|
class ApiKeyApiClient(NotifyAdminAPIClient):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
|
|
||||||
from notifications_python_client.base import BaseAPIClient
|
from app.notify_client import _attach_current_user, NotifyAdminAPIClient
|
||||||
|
|
||||||
from app.notify_client import _attach_current_user
|
|
||||||
from app.notify_client.models import InvitedUser
|
from app.notify_client.models import InvitedUser
|
||||||
|
|
||||||
|
|
||||||
class InviteApiClient(BaseAPIClient):
|
class InviteApiClient(NotifyAdminAPIClient):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from notifications_python_client.base import BaseAPIClient
|
from app.notify_client import _attach_current_user, NotifyAdminAPIClient
|
||||||
from app.notify_client import _attach_current_user
|
|
||||||
|
|
||||||
|
|
||||||
class JobApiClient(BaseAPIClient):
|
class JobApiClient(NotifyAdminAPIClient):
|
||||||
|
|
||||||
JOB_STATUSES = {
|
JOB_STATUSES = {
|
||||||
'scheduled',
|
'scheduled',
|
||||||
|
|||||||
@@ -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):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|||||||
@@ -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):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
from notifications_python_client.base import BaseAPIClient
|
|
||||||
from app.utils import BrowsableItem
|
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
|
# Fudge assert in the super __init__ so
|
||||||
# we can set those variables later.
|
# we can set those variables later.
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|||||||
@@ -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):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -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):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from notifications_python_client.notifications import BaseAPIClient
|
|
||||||
from notifications_python_client.errors import HTTPError
|
from notifications_python_client.errors import HTTPError
|
||||||
|
|
||||||
|
from app.notify_client import NotifyAdminAPIClient
|
||||||
from app.notify_client.models import User
|
from app.notify_client.models import User
|
||||||
|
|
||||||
ALLOWED_ATTRIBUTES = {
|
ALLOWED_ATTRIBUTES = {
|
||||||
@@ -10,7 +10,7 @@ ALLOWED_ATTRIBUTES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class UserApiClient(BaseAPIClient):
|
class UserApiClient(NotifyAdminAPIClient):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("a", "b", "c")
|
super().__init__("a", "b", "c")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user