Skip to content

Additional Documentation

aboden267 edited this page Oct 11, 2026 · 2 revisions

Sprint 2 / 3

Problem / Feature Notes

The current problem is that all events get displayed to any user, including private events.

The goal is to:

  • Set events from the Main Arts Calendar to default to public.
  • Set events from the Additional Events Calendar to default to private.
  • Allow administrators to change individual events between public and private.
  • Prevent guest users from viewing private events.

Google Calendars

Main Arts Calendar

  • Calendar ID: lu4fbqos3ko1n01d3brkf2c8ls@group.calendar.google.com
  • Events should default to public.

Additional Events Calendar

  • Calendar ID: 57acc8f2f23c9fe7d0c6eff31ab9e8171969f586faa60649c671aee47d27e83c@group.calendar.google.com
  • Events should default to private.

Files Involved

Django

  • frontend/models/calendar_model.py
  • frontend/models/event_model.py
  • frontend/admin.py
  • frontend/management/commands/sync_google_calendars.py
  • api/views.py

Flutter

  • lib/api/api_service.dart
  • lib/api/get_events.dart
  • lib/calendar_screen.dart
  • lib/event_details_screen.dart
  • lib/home_screen.dart

Detailed TODO

1. Add Default Visibility to Each Google Calendar

Files:

  • frontend/models/calendar_model.py
  • frontend/admin.py

Tasks:

  • Add a Boolean field such as default_is_public to GoogleCalendar.
  • Main Arts Calendar should default to public.
  • Additional Events should default to private.
  • Expose the field in GoogleCalendarAdmin.

2. Add Visibility to Each Event

File:

  • frontend/models/event_model.py

Tasks:

  • Add an is_public Boolean field to Event.
  • When a new event is imported, set its visibility based on the source calendar's default_is_public.
  • Do not overwrite is_public during later syncs so manual administrator changes persist.

3. Allow Administrators to Override Event Visibility

File:

  • frontend/admin.py

Tasks:

  • Add is_public to EventAdmin.
  • Allow administrators to manually switch an individual event between public and private.
  • Consider displaying visibility in list_display or adding it to list_filter.

4. Filter Private Events from Guests

File:

  • api/views.py

Tasks:

  • Update event_list() so guest users only receive public events.
  • Update event_detail() so guest users cannot bypass the event list and directly request a private event by ID.
  • Both endpoints currently use IsGuestOrAuthenticated, so visibility must also be checked in the API logic.

5. Verify Flutter Event Behavior

Files:

  • lib/api/api_service.dart
  • lib/api/get_events.dart
  • lib/calendar_screen.dart
  • lib/event_details_screen.dart
  • lib/home_screen.dart

Tasks:

  • Confirm ApiService.getEvents() receives the filtered event list from Django.
  • Confirm ApiService.getEvent() cannot retrieve a private event when using a guest account.
  • Verify the calendar and home screens display only the events returned by Django.
  • Verify authenticated users still see the intended private events.
  • No Flutter visibility-filtering logic should be necessary unless testing reveals a problem.

6. Add Tests

Django / Flutter Tests:

  • Main calendar event defaults to public.
  • Additional calendar event defaults to private.
  • Guests cannot see private events in the event list.
  • Guests cannot directly access a private event detail endpoint.
  • Authenticated users can access private events if that is the intended behavior.
  • Administrator visibility overrides persist after a later Google Calendar sync.