Skip to content

Commit

Permalink
fix: Specify timezones in models
Browse files Browse the repository at this point in the history
  • Loading branch information
shirte committed Jan 2, 2025
1 parent 60f9145 commit b84ec8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nerdd_backend/models/job.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional

from pydantic import BaseModel
Expand All @@ -16,7 +16,7 @@ class Job(BaseModel):
job_type: str
source_id: str
params: dict
created_at: datetime = datetime.now()
created_at: datetime = datetime.now(timezone.utc)
status: str
num_entries_total: Optional[int] = None

Expand Down
4 changes: 2 additions & 2 deletions nerdd_backend/models/source.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timezone
from typing import Optional

from pydantic import BaseModel
Expand All @@ -11,7 +11,7 @@ class Source(BaseModel):
format: Optional[str] = None
# the filename that was provided by the user
filename: Optional[str] = None
created_at: datetime = datetime.now()
created_at: datetime = datetime.now(timezone.utc)


class SourcePublic(Source):
Expand Down

0 comments on commit b84ec8a

Please sign in to comment.