Skip to content

feat(events): manage events from an admin page instead of code - #113

Merged
renarin-kholin merged 1 commit into
masterfrom
feat/events-in-db
Nov 28, 2026
Merged

renarin-kholin merged 1 commit into
masterfrom
feat/events-in-db

Conversation

@renarin-kholin

Copy link
Copy Markdown
Member

Summary

  • Events move from the app/data/events.py list into an events table (bind users, created by db.create_all() on start). The home page, /events, event pages, the feedback form and the notification tool read from it through app/events_store.py, which returns the same dict shape, so the public templates did not change
  • Admins add, edit and delete events at /events/admin/manage (linked from the admin menu and profile): dates as real start and end dates, description, highlights, image upload or link, and the usual links. Input is validated, uploads are checked like the notification images and stored in static/uploads/events/ (kept by deploy.sh), and every change needs a CSRF token
  • "Upcoming" now uses the event's last day, so multi day events stay upcoming until they end
  • flask import-events copies the old list (now app/data/events_seed.py) into the table once; it is safe to repeat. Older irregular dates such as "Oct 4th - Oct 5th, 2024" now read like the rest ("October 4 - 5, 2024"), and one broken relative image link is fixed
  • Tests use a temporary SQLite folder (SQLITE_DIR) instead of the local local_*.db files

After deploying, run FLASK_APP=app flask import-events once on the server, or the event sections stay empty.

@renarin-kholin
renarin-kholin merged commit ec53e04 into master Nov 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant