From e246fed5a67b0a05e1767962630c8d0689b13d17 Mon Sep 17 00:00:00 2001 From: Phong Date: Tue, 14 Nov 2023 10:55:29 -0600 Subject: [PATCH] Implement manual event update --- OutlookCalendar.py | 2 -- SimpleEvent.py | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/OutlookCalendar.py b/OutlookCalendar.py index 5f5c4da..8fb8ce0 100644 --- a/OutlookCalendar.py +++ b/OutlookCalendar.py @@ -90,8 +90,6 @@ def main(configs): # Retrieve the group member emails group_members = utils.get_email_list(configs['group_name'], configs['email_list_update_interval']) - #group_members = ["pttran3@illinois.edu"] - # Get access token access_token = utils.acquire_access_token(app, configs['scopes']) diff --git a/SimpleEvent.py b/SimpleEvent.py index aaa17a6..3db86ef 100644 --- a/SimpleEvent.py +++ b/SimpleEvent.py @@ -106,13 +106,19 @@ def create_event_for_shared_calendar(cls, event, net_ids): temp_net_ids = [] for net_id in net_ids: temp_net_ids.append(net_id.split("@")[0]) + net_ids = temp_net_ids + start = SimpleEvent.make_datetime(event['start']['dateTime']) subject = event['subject'] event_identifier = subject.split(' ', 1) # (net_id, status) - # event_identifier[1] in valid_subjects + + if event_identifier[0] not in net_ids: + # this is for manager manual update + return + if (len(event_identifier) == 2 and (event_identifier[1] == "OUT" or event_identifier[1] == "OUT AM" or event_identifier[1] == "OUT PM")): simple_event = cls(event_identifier[0], subject, start) return simple_event