Add doc to grist sync
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -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
|
||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user