Skip to content

Commit 9243988

Browse files
committed
fix: made datetime aware of the timezone
1 parent 1d50019 commit 9243988

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/elections/tables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class Election(Base):
3232
slug: Mapped[str] = mapped_column(String(MAX_ELECTION_SLUG), primary_key=True)
3333
name: Mapped[str] = mapped_column(String(MAX_ELECTION_NAME), nullable=False)
3434
type: Mapped[str] = mapped_column(String(64), default="general_election")
35-
datetime_start_nominations: Mapped[datetime] = mapped_column(DateTime, nullable=False)
36-
datetime_start_voting: Mapped[datetime] = mapped_column(DateTime, nullable=False)
37-
datetime_end_voting: Mapped[datetime] = mapped_column(DateTime, nullable=False)
35+
datetime_start_nominations: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False)
36+
datetime_start_voting: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False)
37+
datetime_end_voting: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False)
3838

3939
# a comma-separated string of positions which must be elements of OfficerPosition
4040
# By giving it the type `StringList`, the database entry will automatically be marshalled to the correct form

0 commit comments

Comments
 (0)