Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

Commit 48e762b

Browse files
authored
Merge pull request #19 from dipcode-software/feat/tests
minor fix for codacy validation
2 parents 7a84750 + cab6fb8 commit 48e762b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ajax_views/mixins.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class AjaxResponseMixin(object):
3737
json_status = AjaxResponseStatus.SUCCESS
3838

3939
def json_to_response(self, action=None, json_status=None, success_url=None,
40-
json_data={}, **response_kwargs):
40+
json_data=None, **response_kwargs):
4141
""" Valid response with next action to be followed by the JS """
4242
data = {
4343
"status": self.get_status(json_status),
4444
"action": self.get_action(action),
45-
"extra_data": self.get_json_data(json_data)
45+
"extra_data": self.get_json_data(json_data or {})
4646
}
4747

4848
if self.action == AjaxResponseAction.REDIRECT:
@@ -71,9 +71,9 @@ def get_status(self, json_status=None):
7171

7272
return self.json_status
7373

74-
def get_json_data(self, json_data={}):
74+
def get_json_data(self, json_data=None):
7575
""" Returns any extra data to add to json """
76-
return json_data
76+
return json_data or {}
7777

7878

7979
class FormAjaxMixin(AjaxResponseMixin):

0 commit comments

Comments
 (0)