Skip to content

Commit a156992

Browse files
committed
Slight code improvement
1 parent d1fbf2e commit a156992

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

O365/calendar.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,10 @@ def __init__(self, event, recurrence=None):
126126
set())
127127
self.__first_day_of_week = recurrence_pattern.get(
128128
self._cc('firstDayOfWeek'), None)
129-
if "type" in recurrence_pattern.keys():
130-
self.__recurrence_type = recurrence_pattern["type"]
129+
self.__recurrence_type = recurrence_pattern.get("type", None)
130+
if self.__recurrence_type:
131131
if "weekly" not in recurrence_pattern["type"].lower():
132132
self.__first_day_of_week = None
133-
else:
134-
self.__recurrence_type = None
135133

136134
self.__day_of_month = recurrence_pattern.get(self._cc('dayOfMonth'),
137135
None)

0 commit comments

Comments
 (0)