feat: switch all timezone naive datetimes to timezone aware
This commit is contained in:
parent
41fc0a73a5
commit
e22abb383c
30 changed files with 322 additions and 226 deletions
|
@ -1,8 +1,9 @@
|
|||
import json
|
||||
from datetime import datetime
|
||||
from typing import Optional, Any
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any, Optional
|
||||
|
||||
from flask import render_template, url_for, flash, redirect, Blueprint, Response
|
||||
from flask import (Blueprint, Response, flash, redirect, render_template,
|
||||
url_for)
|
||||
from flask.typing import ResponseReturnValue
|
||||
from flask_wtf import FlaskForm
|
||||
from sqlalchemy import exc
|
||||
|
@ -103,8 +104,8 @@ def list_new(group_id: Optional[int] = None) -> ResponseReturnValue:
|
|||
list_.branch = form.branch.data
|
||||
list_.role = form.role.data
|
||||
list_.filename = form.filename.data
|
||||
list_.created = datetime.utcnow()
|
||||
list_.updated = datetime.utcnow()
|
||||
list_.added = datetime.now(tz=timezone.utc)
|
||||
list_.updated = datetime.now(tz=timezone.utc)
|
||||
try:
|
||||
db.session.add(list_)
|
||||
db.session.commit()
|
||||
|
@ -176,7 +177,7 @@ def list_edit(list_id: int) -> ResponseReturnValue:
|
|||
list_.branch = form.branch.data
|
||||
list_.role = form.role.data
|
||||
list_.filename = form.filename.data
|
||||
list_.updated = datetime.utcnow()
|
||||
list_.updated = datetime.now(tz=timezone.utc)
|
||||
try:
|
||||
db.session.commit()
|
||||
flash("Saved changes to group.", "success")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue