Commit 4e457abe authored by fred's avatar fred
Browse files

add json response to subscribe view

parent 04c365c3
...@@ -45,6 +45,8 @@ class SubscribeView(CreateView): ...@@ -45,6 +45,8 @@ class SubscribeView(CreateView):
self.object.save() self.object.save()
if not self.object.is_from_bot() and getattr(settings, 'NEWSLETTER_SEND_CONFIRMATION', True): if not self.object.is_from_bot() and getattr(settings, 'NEWSLETTER_SEND_CONFIRMATION', True):
self.object.send_confirmation_email() self.object.send_confirmation_email()
if self.request.headers.get('x-requested-with') == 'XMLHttpRequest':
return JsonResponse({'err': 0})
return resp return resp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment