Skip to content

Commit

Permalink
fix current_app parameter deleted in TemplateResponse in django 1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
idalin committed Nov 10, 2016
1 parent 4b601d8 commit 0080153
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion xadmin/plugins/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def do_action(self, queryset):

# Display the confirmation page
return TemplateResponse(self.request, self.delete_selected_confirmation_template or
self.get_template_list('views/model_delete_selected_confirm.html'), context, current_app=self.admin_site.name)
self.get_template_list('views/model_delete_selected_confirm.html'), context)


class ActionPlugin(BaseAdminPlugin):
Expand Down
2 changes: 1 addition & 1 deletion xadmin/plugins/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def do_action(self, queryset):
})

return TemplateResponse(self.request, self.batch_change_form_template or
self.get_template_list('views/batch_change_form.html'), context, current_app=self.admin_site.name)
self.get_template_list('views/batch_change_form.html'), context)

@filter_hook
def get_media(self):
Expand Down
9 changes: 3 additions & 6 deletions xadmin/plugins/passwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def get(self, request, *args, **kwargs):
context = super(ResetPasswordSendView, self).get_context()
context['form'] = kwargs.get('form', self.password_reset_form())

return TemplateResponse(request, self.password_reset_template, context,
current_app=self.admin_site.name)
return TemplateResponse(request, self.password_reset_template, context)

@csrf_protect_m
def post(self, request, *args, **kwargs):
Expand All @@ -50,8 +49,7 @@ def post(self, request, *args, **kwargs):

form.save(**opts)
context = super(ResetPasswordSendView, self).get_context()
return TemplateResponse(request, self.password_reset_done_template, context,
current_app=self.admin_site.name)
return TemplateResponse(request, self.password_reset_done_template, context)
else:
return self.get(request, form=form)

Expand Down Expand Up @@ -107,8 +105,7 @@ def get(self, request, *args, **kwargs):
context = super(ResetPasswordCompleteView, self).get_context()
context['login_url'] = self.get_admin_url('index')

return TemplateResponse(request, self.password_reset_complete_template, context,
current_app=self.admin_site.name)
return TemplateResponse(request, self.password_reset_complete_template, context)

site.register_view(r'^xadmin/password_reset/complete/$', ResetPasswordCompleteView, name='xadmin_password_reset_complete')

11 changes: 5 additions & 6 deletions xadmin/plugins/xversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ def get(self, request, *args, **kwargs):

return TemplateResponse(
request, self.recover_list_template or self.get_template_list(
"views/recover_list.html"),
context, current_app=self.admin_site.name)
"views/recover_list.html"), context)


class RevisionListView(BaseReversionView):
Expand Down Expand Up @@ -259,7 +258,7 @@ def get_response(self):
context = self.get_context()

return TemplateResponse(self.request, self.object_history_template or
self.get_template_list('views/model_history.html'), context, current_app=self.admin_site.name)
self.get_template_list('views/model_history.html'), context)

def get_version_object(self, version):
obj_version = version._object_version
Expand Down Expand Up @@ -340,7 +339,7 @@ def post(self, request, object_id, *args, **kwargs):

return TemplateResponse(
self.request, self.revision_diff_template or self.get_template_list('views/revision_diff.html'),
context, current_app=self.admin_site.name)
context)

@filter_hook
def get_media(self):
Expand Down Expand Up @@ -433,7 +432,7 @@ def get_response(self):
return TemplateResponse(
self.request, form_template or self.get_template_list(
'views/revision_form.html'),
context, current_app=self.admin_site.name)
context)

@filter_hook
def post_response(self):
Expand Down Expand Up @@ -470,7 +469,7 @@ def get_response(self):
return TemplateResponse(
self.request, form_template or self.get_template_list(
'views/recover_form.html'),
context, current_app=self.admin_site.name)
context)

@filter_hook
def post_response(self):
Expand Down

0 comments on commit 0080153

Please sign in to comment.