Skip to content

fix: replace deprecated datetime.utcnow in database models#474

Open
Arijit429 wants to merge 10 commits intofireform-core:mainfrom
Arijit429:fix/deprecated-utcnow-db-models
Open

fix: replace deprecated datetime.utcnow in database models#474
Arijit429 wants to merge 10 commits intofireform-core:mainfrom
Arijit429:fix/deprecated-utcnow-db-models

Conversation

@Arijit429
Copy link
Copy Markdown

Problem

datetime.utcnow is deprecated since Python 3.12 and was missed
in the previous fix (PR #449). It is used as default_factory
in both Template and FormSubmission models in api/db/models.py.

Fix

  • Import timezone from datetime
  • Replace default_factory=datetime.utcnow with
    default_factory=lambda: datetime.now(timezone.utc) in both models

Files Changed

  • api/db/models.py

Closes #[your issue number]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant