Spaces:
Sleeping
Sleeping
Upload app/calendar/service.py with huggingface_hub
Browse files- app/calendar/service.py +5 -1
app/calendar/service.py
CHANGED
|
@@ -12,12 +12,16 @@ class CalendarService:
|
|
| 12 |
"""Service for interacting with Google Calendar."""
|
| 13 |
|
| 14 |
def __init__(self):
|
| 15 |
-
self.auth =
|
| 16 |
self.calendar_id = settings.google_calendar_id
|
| 17 |
self.default_timezone = pytz.timezone(settings.default_timezone)
|
| 18 |
|
| 19 |
def _get_service(self):
|
| 20 |
"""Get authenticated calendar service."""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
try:
|
| 22 |
service = self.auth.get_calendar_service()
|
| 23 |
if not service:
|
|
|
|
| 12 |
"""Service for interacting with Google Calendar."""
|
| 13 |
|
| 14 |
def __init__(self):
|
| 15 |
+
self.auth = None # Lazy initialization
|
| 16 |
self.calendar_id = settings.google_calendar_id
|
| 17 |
self.default_timezone = pytz.timezone(settings.default_timezone)
|
| 18 |
|
| 19 |
def _get_service(self):
|
| 20 |
"""Get authenticated calendar service."""
|
| 21 |
+
if self.auth is None:
|
| 22 |
+
from app.calendar.auth import CalendarAuth
|
| 23 |
+
self.auth = CalendarAuth()
|
| 24 |
+
|
| 25 |
try:
|
| 26 |
service = self.auth.get_calendar_service()
|
| 27 |
if not service:
|