mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-06 00:48:46 -04:00
notify-api-412 use black to enforce python coding style
This commit is contained in:
@@ -2,51 +2,50 @@ from app.notify_client import NotifyAdminAPIClient, _attach_current_user
|
||||
|
||||
|
||||
class OrgInviteApiClient(NotifyAdminAPIClient):
|
||||
|
||||
def init_app(self, app):
|
||||
super().init_app(app)
|
||||
|
||||
self.admin_url = app.config['ADMIN_BASE_URL']
|
||||
self.admin_url = app.config["ADMIN_BASE_URL"]
|
||||
|
||||
def create_invite(self, invite_from_id, org_id, email_address):
|
||||
data = {
|
||||
'email_address': email_address,
|
||||
'invited_by': invite_from_id,
|
||||
'invite_link_host': self.admin_url,
|
||||
"email_address": email_address,
|
||||
"invited_by": invite_from_id,
|
||||
"invite_link_host": self.admin_url,
|
||||
}
|
||||
data = _attach_current_user(data)
|
||||
resp = self.post(url='/organization/{}/invite'.format(org_id), data=data)
|
||||
return resp['data']
|
||||
resp = self.post(url="/organization/{}/invite".format(org_id), data=data)
|
||||
return resp["data"]
|
||||
|
||||
def get_invites_for_organization(self, org_id):
|
||||
endpoint = '/organization/{}/invite'.format(org_id)
|
||||
endpoint = "/organization/{}/invite".format(org_id)
|
||||
resp = self.get(endpoint)
|
||||
return resp['data']
|
||||
return resp["data"]
|
||||
|
||||
def get_invited_user_for_org(self, org_id, invited_org_user_id):
|
||||
return self.get(
|
||||
f'/organization/{org_id}/invite/{invited_org_user_id}'
|
||||
)['data']
|
||||
return self.get(f"/organization/{org_id}/invite/{invited_org_user_id}")["data"]
|
||||
|
||||
def get_invited_user(self, invited_user_id):
|
||||
return self.get(
|
||||
f'/invite/organization/{invited_user_id}'
|
||||
)['data']
|
||||
return self.get(f"/invite/organization/{invited_user_id}")["data"]
|
||||
|
||||
def check_token(self, token):
|
||||
resp = self.get(url='/invite/organization/check/{}'.format(token))
|
||||
return resp['data']
|
||||
resp = self.get(url="/invite/organization/check/{}".format(token))
|
||||
return resp["data"]
|
||||
|
||||
def cancel_invited_user(self, org_id, invited_user_id):
|
||||
data = {'status': 'cancelled'}
|
||||
data = {"status": "cancelled"}
|
||||
data = _attach_current_user(data)
|
||||
self.post(url='/organization/{0}/invite/{1}'.format(org_id, invited_user_id),
|
||||
data=data)
|
||||
self.post(
|
||||
url="/organization/{0}/invite/{1}".format(org_id, invited_user_id),
|
||||
data=data,
|
||||
)
|
||||
|
||||
def accept_invite(self, org_id, invited_user_id):
|
||||
data = {'status': 'accepted'}
|
||||
self.post(url='/organization/{0}/invite/{1}'.format(org_id, invited_user_id),
|
||||
data=data)
|
||||
data = {"status": "accepted"}
|
||||
self.post(
|
||||
url="/organization/{0}/invite/{1}".format(org_id, invited_user_id),
|
||||
data=data,
|
||||
)
|
||||
|
||||
|
||||
org_invite_api_client = OrgInviteApiClient()
|
||||
|
||||
Reference in New Issue
Block a user