From 4ecf9e5b6966bc3dc69294b70f7dc9845a04cc8b Mon Sep 17 00:00:00 2001 From: Mugerwa Joseph Date: Fri, 6 Dec 2019 18:39:36 +0200 Subject: [PATCH] CV3-86-story(allow-push-notifications-staging): Implement functionality that allows Staging to receive Push Notifications - Implement functionality that allows Staging to receive Push Notifications [Delivers CV3-86] --- service/push_notification.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/service/push_notification.py b/service/push_notification.py index b5ec2c3..a43ffde 100644 --- a/service/push_notification.py +++ b/service/push_notification.py @@ -129,6 +129,13 @@ def manual_create_channels(self): "type": "web_hook", "address": notification_url } + + staging_request_body = { + "id": None, + "type": "web_hook", + "address": os.getenv("DEV_NOTIFICATION_URL") + } + service = Credentials.set_api_credentials(self) calendar = {} calendars = [] @@ -151,6 +158,11 @@ def manual_create_channels(self): channel = service.events().watch( calendarId=calendar['calendar_id'], body=request_body).execute() + + _stanging_channel = service.events().watch( + calendarId=calendar['calendar_id'], + body=staging_request_body).execute() + except errors.HttpError as error: print('An error occurred', error) continue