fix(backend): Ensure event details are updated

Fixed an issue where event name and description were not being updated
correctly from the provided JSON data in the update_event function.
master
John Montagu, the 4th Earl of Sandvich 2024-12-07 17:22:19 -08:00
parent 42b7e603f0
commit ad45e1530e
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
2 changed files with 4 additions and 1 deletions

View File

@ -292,6 +292,9 @@ def update_event(player: Player, event_id: int, json: UpdateEventJson, **_):
else:
player_event.role = None
event.name = json.name
event.description = json.description
db.session.commit()
event.update_discord_message()

View File

@ -23,7 +23,7 @@ class Event(app_db.BaseModel):
name: Mapped[str] = mapped_column(String(255), nullable=False)
start_time: Mapped[datetime] = mapped_column(UtcDateTime, nullable=False)
description: Mapped[str] = mapped_column(Text, nullable=True)
description: Mapped[str | None] = mapped_column(Text, nullable=True)
created_at: Mapped[datetime] = mapped_column(TIMESTAMP, server_default=func.now())
discord_message_id: Mapped[int | None] = mapped_column(BigInteger, nullable=True)