New mobile:calendar_feed (/app/calendar/<token>.ics) -- a standard webcal-style subscription feed calendar apps can poll, so a family's schedule shows up in Apple/Google/Outlook Calendar alongside everything else. Token-authenticated rather than session-authenticated (calendar apps can't do interactive login); CalendarFeedToken is deliberately not club-scoped, since the same token works under whichever club subdomain the request is fetched from -- an account active in more than one club needs only the one link. Combined across every managed person (their name goes in the event title when there's more than one), every event they're invited to regardless of RSVP status, not capped to Calendar's own 2-week window -- a synced calendar app is exactly where someone wants the whole season visible. A cancelled event stays in the feed as STATUS:CANCELLED rather than disappearing, so it's removed properly on the subscriber's next refresh instead of just vanishing. New mobile:calendar_feed_settings (linked from Me) shows the webcal:// and https:// links plus a "reset my calendar link" action that immediately invalidates the old one. Uses the icalendar package for RFC 5545 generation rather than hand-rolling escaping/line-folding. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
33 lines
1.3 KiB
Python
33 lines
1.3 KiB
Python
# Generated by Django 6.0.6 on 2026-08-21 13:09
|
|
|
|
import django.db.models.deletion
|
|
import mobile.models
|
|
import uuid
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('mobile', '0001_initial'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='CalendarFeedToken',
|
|
fields=[
|
|
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
|
|
('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('token', models.CharField(default=mobile.models._generate_feed_token, editable=False, max_length=64, unique=True, verbose_name='token')),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='calendar_feed_token', to=settings.AUTH_USER_MODEL, verbose_name='user')),
|
|
],
|
|
options={
|
|
'verbose_name': 'calendar feed token',
|
|
'verbose_name_plural': 'calendar feed tokens',
|
|
},
|
|
),
|
|
]
|