Skip to content
Snippets Groups Projects
Commit af70dd32 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Reformat

parent b144caf3
No related branches found
No related tags found
1 merge request!601Resolve "favicon / icon generation mauls database"
Pipeline #10754 passed
......@@ -278,9 +278,11 @@ def monkey_patch() -> None: # noqa
# Unwrap promises in JSON serializer instead of stringifying
from django.core.serializers import json
from django.utils.functional import Promise
class DjangoJSONEncoder(json.DjangoJSONEncoder):
def default(self, o: Any) -> Any:
if isinstance(o, Promise) and hasattr(o, "copy"):
return o.copy()
return super().default(o)
json.DjangoJSONEncoder = DjangoJSONEncoder
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment