diff --git a/src/pretix/helpers/json.py b/src/pretix/helpers/json.py index 44e7bf180..9dc95fc09 100644 --- a/src/pretix/helpers/json.py +++ b/src/pretix/helpers/json.py @@ -1,3 +1,4 @@ +from django.core.files import File from i18nfield.utils import I18nJSONEncoder from pretix.base.reldate import RelativeDateWrapper @@ -7,6 +8,8 @@ class CustomJSONEncoder(I18nJSONEncoder): def default(self, obj): if isinstance(obj, RelativeDateWrapper): return obj.to_string() + elif isinstance(obj, File): + return obj.name else: return super().default(obj)