Commit e201a321 authored by stef's avatar stef

[fix] 404 on already confirmed

parent e68a234b
...@@ -97,10 +97,12 @@ def confirm(request, id, name=None): ...@@ -97,10 +97,12 @@ def confirm(request, id, name=None):
return HttpResponse(unicode(_("Thank you, this has been already confirmed"))) return HttpResponse(unicode(_("Thank you, this has been already confirmed")))
c.save() c.save()
return HttpResponse('<div class="confirm_thanks">%s</div>' % unicode(_('Thank you for your confirmation')) ) return HttpResponse('<div class="confirm_thanks">%s</div>' % unicode(_('Thank you for your confirmation')) )
c=Confirmation.objects.get(key=id) try:
if c: c = get_object_or_404(Confirmation, key=id)
c.key='' except:
c.save() return HttpResponse(unicode(_("Thank you, this has been already confirmed")))
c.key=''
c.save()
messages.add_message(request, messages.INFO, unicode(_('Thank you for verifying your confirmation'))) messages.add_message(request, messages.INFO, unicode(_('Thank you for verifying your confirmation')))
return HttpResponseRedirect('/') # Redirect after POST return HttpResponseRedirect('/') # Redirect after POST
......
Markdown is supported
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