File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
tests/integrations/django/myapp Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,9 @@ def safe_repr(value):
310
310
def object_to_json (obj ):
311
311
def _walk (obj , depth ):
312
312
if depth < 4 :
313
- if isinstance (obj , Sequence ) and not isinstance (obj , (bytes , text_type )):
313
+ if isinstance (obj , (list , tuple )):
314
+ # It is not safe to iterate over another sequence types as this may raise errors or
315
+ # bring undesired side-effects (e.g. Django querysets are executed during iteration)
314
316
return [_walk (x , depth + 1 ) for x in obj ]
315
317
if isinstance (obj , Mapping ):
316
318
return {safe_str (k ): _walk (v , depth + 1 ) for k , v in obj .items ()}
Original file line number Diff line number Diff line change 1
1
from django .contrib .auth import login
2
2
from django .contrib .auth .models import User
3
3
from django .http import HttpResponse , HttpResponseServerError , HttpResponseNotFound
4
- from django .shortcuts import render_to_response
4
+ from django .shortcuts import render
5
5
from django .views .generic import ListView
6
6
7
7
import sentry_sdk
@@ -45,5 +45,5 @@ def handler404(*args, **kwargs):
45
45
return HttpResponseNotFound ("404" )
46
46
47
47
48
- def template_exc (* args , ** kwargs ):
49
- return render_to_response ( "error.html" )
48
+ def template_exc (request , * args , ** kwargs ):
49
+ return render ( request , "error.html" )
You can’t perform that action at this time.
0 commit comments