diff --git a/backend/src/project/models.py b/backend/src/project/models.py index 627bee4a..389cc915 100644 --- a/backend/src/project/models.py +++ b/backend/src/project/models.py @@ -13,7 +13,7 @@ class Project(Base): deadline: Mapped[datetime] = mapped_column( DateTime(timezone=True), nullable=False) publish_date: Mapped[datetime] = mapped_column( - DateTime(timezone=True), nullable=True, default=datetime.now() + DateTime(timezone=True), nullable=True, default=datetime.now ) name: Mapped[str] = mapped_column(nullable=False) subject_id: Mapped[int] = mapped_column( diff --git a/backend/src/subject/models.py b/backend/src/subject/models.py index 835182ba..cf257a82 100644 --- a/backend/src/subject/models.py +++ b/backend/src/subject/models.py @@ -24,7 +24,7 @@ class Subject(Base): id: Mapped[int] = mapped_column(primary_key=True) academic_year: Mapped[int] = mapped_column( - nullable=False, default=datetime.now().year) - uuid: Mapped[str] = mapped_column(default=str(uuid4())) + nullable=False, default=lambda _: datetime.now().year) + uuid: Mapped[str] = mapped_column(default=lambda _: str(uuid4())) email: Mapped[str] = mapped_column(nullable=True) name: Mapped[str]