Add doc to grist sync

This commit is contained in:
2025-10-27 11:35:52 +01:00
parent 9efccccc21
commit a2722d5f9f
2 changed files with 10 additions and 2 deletions

5
.gitignore vendored
View File

@@ -1,5 +1,6 @@
config.php config.php
test.php test.php
melly-to-grist/.env .env
**/__pycache__ **/__pycache__
new-registration-app/database.db database.db*
.idea

View File

@@ -433,7 +433,14 @@ def get_event_attendance_pdf(event_id: int, session: SessionDep):
@app.get("/event/{event_id}/sync_with_grist") @app.get("/event/{event_id}/sync_with_grist")
def sync_with_grist_route(event_id: int, session: SessionDep, user: StrictUserDep): def sync_with_grist_route(event_id: int, session: SessionDep, user: StrictUserDep):
"""
Synchronizes the specified event with Grist and redirects the user.
This function retrieves the event by its identifier, synchronizes it with Grist,
and then redirects the user to the event page with a success message.
TODO: Error handling
"""
statement = select(Event).where(Event.id == event_id) statement = select(Event).where(Event.id == event_id)
event = session.scalars(statement).one() event = session.scalars(statement).one()