diff --git a/bahea_cal/fetch.py b/bahea_cal/fetch.py index 3f756ee..af14001 100644 --- a/bahea_cal/fetch.py +++ b/bahea_cal/fetch.py @@ -14,6 +14,7 @@ import arrow import attrs +from django.conf import settings from django.db import transaction from core.models import Team, Championship, Location, Phase, Round, Match, SoccerEvent @@ -39,7 +40,7 @@ def from_parsed(cls, event): if match.location: description += f", {match.location.popular_name}" return cls( - summary=f"[{match.championship.name}] {match.home_team.popular_name} x {match.away_team.popular_name}", + summary=f"{settings.CALENDAR_NAME_PREFIX}[{match.championship.name}] {match.home_team.popular_name} x {match.away_team.popular_name}", description=description, start_datetime=arrow.get(match.start_at).to(timezone), start_timezone=timezone, diff --git a/core/views.py b/core/views.py index b7edf49..a65382b 100644 --- a/core/views.py +++ b/core/views.py @@ -92,7 +92,7 @@ def google_calendar_redirect_view(request): service = googleapiclient.discovery.build(API_SERVICE_NAME, API_VERSION, credentials=credentials) if not user.calendar_id: - calendar = {"summary": "BaheaCal", "timeZone": "America/Bahia"} + calendar = {"summary": f"{settings.CALENDAR_NAME_PREFIX}BaheaCal", "timeZone": "America/Bahia"} created_calendar = service.calendars().insert(body=calendar).execute() user.calendar_id = created_calendar["id"] user.save(update_fields=["calendar_id"]) diff --git a/webapp/settings.py b/webapp/settings.py index db864dd..b509b7c 100644 --- a/webapp/settings.py +++ b/webapp/settings.py @@ -34,6 +34,8 @@ DEBUG = djsettings.get("DEBUG", False, cast="@bool") ENVIRONMENT = djsettings.ENVIRONMENT +CALENDAR_NAME_PREFIX = djsettings.get('CALENDAR_NAME_PREFIX', '', cast="@str") + AUTH_USER_MODEL = "users.User"