Skip to content

Commit 026c72c

Browse files
committed
Actually allow modifying JSON encoder
1 parent dafda82 commit 026c72c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

inertia/http.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def build_first_load_context_and_template(self, data):
160160

161161

162162
class InertiaResponse(BaseInertiaResponseMixin, HttpResponse):
163-
json_encoder = settings.INERTIA_JSON_ENCODER
163+
json_encoder = None
164164

165165
def __init__(
166166
self,
@@ -178,7 +178,10 @@ def __init__(
178178
self.template_data = template_data or {}
179179
_headers = headers or {}
180180

181-
data = json_encode(self.page_data(), cls=self.json_encoder)
181+
data = json_encode(
182+
self.page_data(),
183+
cls=self.json_encoder or settings.INERTIA_JSON_ENCODER,
184+
)
182185

183186
if self.request.is_inertia():
184187
_headers = {

0 commit comments

Comments
 (0)