feat: switch all timezone naive datetimes to timezone aware

This commit is contained in:
Iain Learmonth 2024-12-06 16:08:48 +00:00
parent 41fc0a73a5
commit e22abb383c
30 changed files with 322 additions and 226 deletions

View file

@ -1,11 +1,12 @@
from datetime import datetime
from datetime import datetime, timezone
from typing import Optional
from flask import Blueprint, flash, Response, render_template, redirect, url_for
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
from wtforms import StringField, SelectField, SubmitField
from wtforms import SelectField, StringField, SubmitField
from wtforms.validators import DataRequired
from app.extensions import db
@ -70,7 +71,7 @@ def webhook_edit(webhook_id: int) -> ResponseReturnValue:
webhook.description = form.description.data
webhook.format = form.description.data
webhook.url = form.description.data
webhook.updated = datetime.utcnow()
webhook.updated = datetime.now(tz=timezone.utc)
try:
db.session.commit()
flash("Saved changes to webhook.", "success")