Skip to content

TypeError: Object of type datetime is not JSON serializable #3108

Description

@sentry

Sentry Issue: ONADATA-XPW

SerializationFailure: canceling statement due to conflict with recovery
DETAIL:  User query might have needed to see row versions that must be removed.

  File "django/db/backends/utils.py", line 105, in _execute
    return self.cursor.execute(sql, params)

OperationalError: canceling statement due to conflict with recovery
DETAIL:  User query might have needed to see row versions that must be removed.

(18 additional frame(s) were not displayed)
...
  File "onadata/apps/api/viewsets/dataview_viewset.py", line 261, in form_details
    return Response(data=serializer.data, content_type="application/json")
  File "onadata/libs/serializers/xform_serializer.py", line 614, in get_form_versions
    versions = list(

TypeError: Object of type datetime is not JSON serializable
(4 additional frame(s) were not displayed)
...
  File "onadata/libs/renderers/renderers.py", line 575, in render
    return json.dumps(data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions