Logo
Explore Help
Sign In
darkhelm/notifications-admin
1
0
Fork 0
You've already forked notifications-admin
mirror of https://github.com/GSA/notifications-admin.git synced 2026-05-21 09:01:34 -04:00
Code Issues Packages Projects Releases Wiki Activity
Files
save_csv
notifications-admin/app/notify_client/events_api_client.py

12 lines
331 B
Python
Raw Permalink Normal View History

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.
2016-11-30 17:01:44 +00:00
from app.notify_client import NotifyAdminAPIClient
Record login including remembered user login events to the api based of flask login signals.
2016-04-27 16:39:17 +01: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.
2016-11-30 17:01:44 +00:00
class EventsApiClient(NotifyAdminAPIClient):
Record login including remembered user login events to the api based of flask login signals.
2016-04-27 16:39:17 +01:00
def create_event(self, event_type, event_data):
notify-api-412 use black to enforce python coding style
2023-08-25 09:12:23 -07:00
data = {"event_type": event_type, "data": event_data}
resp = self.post(url="/events", data=data)
return resp["data"]
Initialise clients outside the app This avoids the annoying problem where you can’t import a client unless the app has already been initialised.
2018-10-26 15:39:32 +01:00
events_api_client = EventsApiClient()
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.0 Page: 3198ms Template: 86ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API