Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions invenio_db/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

"""Shared database object for Invenio."""

import warnings
from datetime import datetime, timezone

from flask_sqlalchemy import SQLAlchemy as FlaskSQLAlchemy
Expand Down Expand Up @@ -44,6 +45,11 @@ def process_bind_param(self, value, dialect):
return value

if isinstance(value, str):
warnings.warn(
"UTCDateTime: string values are deprecated, please pass a datetime object. "
"String values will be removed in the next major release (3.0.0).",
DeprecationWarning,
)
if " " in value:
value = value.replace(" ", "T")
value = datetime.strptime(value[0:19], "%Y-%m-%dT%H:%M:%S")
Expand Down
Loading