From 606c841e4c0c6d01a8aa1110dee4145855f3324f Mon Sep 17 00:00:00 2001 From: Kriti Godey Date: Thu, 22 Apr 2010 14:48:18 -0400 Subject: [PATCH] Updated redirects. --- templates/loggedin.html | 2 ++ templates/nopermission.html | 7 +++++++ templates/notloggedin.html | 2 ++ views.py | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 templates/nopermission.html diff --git a/templates/loggedin.html b/templates/loggedin.html index 034852d..d46c57e 100644 --- a/templates/loggedin.html +++ b/templates/loggedin.html @@ -1,3 +1,5 @@ +{% block title %}ERROR!{% endblock %} + {% extends "base.html" %} {% block content %} diff --git a/templates/nopermission.html b/templates/nopermission.html new file mode 100644 index 0000000..4305b4a --- /dev/null +++ b/templates/nopermission.html @@ -0,0 +1,7 @@ +{% block title %}ERROR!{% endblock %} + +{% extends "base.html" %} + +{% block content %} +

You do not have permission to perform this action!

+{% endblock %} \ No newline at end of file diff --git a/templates/notloggedin.html b/templates/notloggedin.html index 15d9bb8..4fae865 100644 --- a/templates/notloggedin.html +++ b/templates/notloggedin.html @@ -1,3 +1,5 @@ +{% block title %}ERROR!{% endblock %} + {% extends "base.html" %} {% block content %} diff --git a/views.py b/views.py index e3912c2..b5d68ff 100644 --- a/views.py +++ b/views.py @@ -57,7 +57,7 @@ def edit_sandwich(request, slug): sedit = Sandwich.objects.get(slug=slug) ingred = sedit.ingredients.all() if not sedit.user == request.user: - return HttpResponseRedirect(reverse('all_sandwiches')) + return render_to_response('nopermission.html', context_instance=RequestContext(request)) else: if request.method == 'POST': sform = SandwichForm(request.POST, request.FILES, instance=sedit) -- 2.20.1