mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 21:38:48 +00:00
fixes: response data stays persistent throughout views
This commit is contained in:
parent
b4412ef575
commit
a3517b9313
@ -337,7 +337,7 @@ class AjaxMixin(InvenTreeRoleMixin):
|
|||||||
# Do nothing by default
|
# Do nothing by default
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def renderJsonResponse(self, request, form=None, data={}, context=None):
|
def renderJsonResponse(self, request, form=None, data=None, context=None):
|
||||||
""" Render a JSON response based on specific class context.
|
""" Render a JSON response based on specific class context.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -349,6 +349,9 @@ class AjaxMixin(InvenTreeRoleMixin):
|
|||||||
Returns:
|
Returns:
|
||||||
JSON response object
|
JSON response object
|
||||||
"""
|
"""
|
||||||
|
# a empty dict as default can be dangerous - set it here if empty
|
||||||
|
if not data:
|
||||||
|
data = {}
|
||||||
|
|
||||||
if not request.is_ajax():
|
if not request.is_ajax():
|
||||||
return HttpResponseRedirect('/')
|
return HttpResponseRedirect('/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user