diff --git a/apiserver/plane/app/views/issue/base.py b/apiserver/plane/app/views/issue/base.py index b1fd1a9bc..fad85b79d 100644 --- a/apiserver/plane/app/views/issue/base.py +++ b/apiserver/plane/app/views/issue/base.py @@ -447,7 +447,7 @@ class IssueViewSet(BaseViewSet): ) datetime_fields = ["created_at", "updated_at"] issues = user_timezone_converter( - issue_queryset, datetime_fields, request.user.user_timezone + issues, datetime_fields, request.user.user_timezone ) return Response(issues, status=status.HTTP_200_OK) diff --git a/apiserver/plane/utils/user_timezone_converter.py b/apiserver/plane/utils/user_timezone_converter.py index 579b96c26..c946cfb27 100644 --- a/apiserver/plane/utils/user_timezone_converter.py +++ b/apiserver/plane/utils/user_timezone_converter.py @@ -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