Updated redirects.
authorKriti Godey <kriti.godey@gmail.com>
Thu, 22 Apr 2010 18:48:18 +0000 (14:48 -0400)
committerKriti Godey <kriti.godey@gmail.com>
Thu, 22 Apr 2010 18:48:18 +0000 (14:48 -0400)
templates/loggedin.html
templates/nopermission.html [new file with mode: 0644]
templates/notloggedin.html
views.py

index 034852d..d46c57e 100644 (file)
@@ -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 (file)
index 0000000..4305b4a
--- /dev/null
@@ -0,0 +1,7 @@
+{% block title %}ERROR!{% endblock %}
+
+{% extends "base.html" %}
+
+{% block content %}
+       <h1 class="pagetitle">You do not have permission to perform this action!</h1>
+{% endblock %}
\ No newline at end of file
index 15d9bb8..4fae865 100644 (file)
@@ -1,3 +1,5 @@
+{% block title %}ERROR!{% endblock %}
+
 {% extends "base.html" %}
 
 {% block content %}
index e3912c2..b5d68ff 100644 (file)
--- 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)