Additional Documentation - aboden267/ctrl-alt-elite GitHub Wiki
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:
[email protected] - 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.pyfrontend/models/event_model.pyfrontend/admin.pyfrontend/management/commands/sync_google_calendars.pyapi/views.py
Flutter
lib/api/api_service.dartlib/api/get_events.dartlib/calendar_screen.dartlib/event_details_screen.dartlib/home_screen.dart
Detailed TODO
1. Add Default Visibility to Each Google Calendar
Files:
frontend/models/calendar_model.pyfrontend/admin.py
Tasks:
- Add a Boolean field such as
default_is_publictoGoogleCalendar. - 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_publicBoolean field toEvent. - When a new event is imported, set its visibility based on the source calendar's
default_is_public. - Do not overwrite
is_publicduring later syncs so manual administrator changes persist.
3. Allow Administrators to Override Event Visibility
File:
frontend/admin.py
Tasks:
- Add
is_publictoEventAdmin. - Allow administrators to manually switch an individual event between public and private.
- Consider displaying visibility in
list_displayor adding it tolist_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.dartlib/api/get_events.dartlib/calendar_screen.dartlib/event_details_screen.dartlib/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.