1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #27544 -- Fixed QuerySet.update(dt=F('dt') + timedelta) crash on SQLite.

This commit is contained in:
Andrew Nester
2016-11-29 20:23:44 +03:00
committed by Tim Graham
parent fb3716b156
commit ade52ef71f
3 changed files with 14 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ class DatabaseOperations(BaseDatabaseOperations):
if value is not None:
if not isinstance(value, datetime.datetime):
value = parse_datetime(value)
if settings.USE_TZ:
if settings.USE_TZ and not timezone.is_aware(value):
value = timezone.make_aware(value, self.connection.timezone)
return value