1.0 KiB
1.0 KiB
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | |
|---|---|---|---|---|---|---|---|---|---|
| task-9 | Fix event_count in sources API | Done | 2026-01-02 14:30 | 2026-01-02 17:10 |
|
medium |
Description
The event_count field shows 0 for all sources - need to update the sync command or serializer to compute correct counts
Resolution
No fix needed - the backend already correctly computes event_count.
The serializer in /opt/apps/pkmn/calendar_hub/serializers.py already has:
def get_event_count(self, obj):
return obj.events.count()
And the UnifiedEvent model has related_name='events' on the source FK.
Verified the API returns correct counts:
- jeffemmett@gmail.com: 1,955 events
- jeff@block.science: 888 events
- jessica.zartler@gmail.com: 859 events
- givethdotio@gmail.com: 663 events
The initial "0 for all sources" was because no events had been synced yet. After running sync_google_to_unified, the counts are correct.