chore: created by key changed (#4389)
This commit is contained in:
parent
a40517015b
commit
d946c51ef1
2 changed files with 3 additions and 3 deletions
|
|
@ -8,14 +8,14 @@ def user_timezone_converter(queryset, datetime_fields, user_timezone):
|
|||
if isinstance(queryset, dict):
|
||||
queryset_values = [queryset]
|
||||
else:
|
||||
queryset_values = list(queryset.values())
|
||||
queryset_values = list(queryset)
|
||||
|
||||
# Iterate over the dictionaries in the list
|
||||
for item in queryset_values:
|
||||
# Iterate over the datetime fields
|
||||
for field in datetime_fields:
|
||||
# Convert the datetime field to the user's timezone
|
||||
if item[field]:
|
||||
if field in item and item[field]:
|
||||
item[field] = item[field].astimezone(user_tz)
|
||||
|
||||
# If queryset was a single item, return a single item
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue