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
parent
42b7e603f0
commit
ad45e1530e
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue