Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

redirect to template after flag if no next specified

  • Loading branch information...
commit 83bdc4eae6de94d9d0e99e98302c1904e607ee3b 1 parent 6f7d4d4
Abdulaziz AlMalki authored
View
10 flag/templates/flag/thank_you.html
@@ -0,0 +1,10 @@
+{% load i18n %}
+
+<h3>{% trans 'Thank you' %}</h3>
+{% if messages %}
+<div class="messages">
+ {% for message in messages %}
+ <p class=" alert alert-{% if message.tags %}{{ message.tags }}{% endif %}">{{ message }}</p>
+ {% endfor %}
+</div>
+{% endif %}
View
2  flag/urls.py
@@ -1,6 +1,8 @@
from django.conf.urls.defaults import *
+from django.views.generic import TemplateView
urlpatterns = patterns("",
url(r"^$", "flag.views.flag", name="flag"),
+ url(r'^thank_you', TemplateView.as_view(template_name="flag/thank_you.html"), name='flag-reported'),
)
View
3  flag/views.py
@@ -1,3 +1,4 @@
+from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import get_object_or_404
@@ -34,4 +35,4 @@ def flag(request):
if next:
return HttpResponseRedirect(next)
else:
- return Http404
+ return HttpResponseRedirect(reverse('flag-reported'))
Please sign in to comment.
Something went wrong with that request. Please try again.