mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 14:48:25 -04:00
remove datetime.utcnow()
This commit is contained in:
@@ -15,12 +15,12 @@ session events.
|
||||
|
||||
"""
|
||||
|
||||
import datetime
|
||||
|
||||
from sqlalchemy import Column, ForeignKeyConstraint, Integer, Table, util
|
||||
from sqlalchemy.orm import attributes, object_mapper, registry
|
||||
from sqlalchemy.orm.properties import ColumnProperty, RelationshipProperty
|
||||
|
||||
from app.utils import utc_now
|
||||
|
||||
|
||||
def col_references_table(col, table):
|
||||
for fk in col.foreign_keys:
|
||||
@@ -236,10 +236,10 @@ def create_history(obj, history_cls=None):
|
||||
|
||||
if not obj.version:
|
||||
obj.version = 1
|
||||
obj.created_at = datetime.datetime.utcnow()
|
||||
obj.created_at = utc_now()
|
||||
else:
|
||||
obj.version += 1
|
||||
now = datetime.datetime.utcnow()
|
||||
now = utc_now()
|
||||
obj.updated_at = now
|
||||
data["updated_at"] = now
|
||||
|
||||
|
||||
Reference in New Issue
Block a user