Skip to content
Browse files

Switch to RequestContext to that the user template tag is available.

  • Loading branch information...
1 parent 8cd7260 commit 5e812783de0a606d62097fef6cb8e6d356aecfed @grokcode committed Apr 3, 2012
Showing with 11 additions and 3 deletions.
  1. +4 −1 cab/views/bookmarks.py
  2. +7 −2 cab/views/snippets.py
View
5 cab/views/bookmarks.py
@@ -2,6 +2,7 @@
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required
from django.views.generic.list_detail import object_list
+from django.template import RequestContext
from cab.models import Bookmark, Snippet
@@ -32,7 +33,9 @@ def delete_bookmark(request, snippet_id):
return HttpResponseRedirect(snippet.get_absolute_url())
else:
return render_to_response('cab/confirm_bookmark_delete.html',
- {'snippet': snippet})
+ {'snippet': snippet},
+ context_instance=RequestContext(request))
+
delete_bookmark = login_required(delete_bookmark)
View
9 cab/views/snippets.py
@@ -3,6 +3,7 @@
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden
+from django.template import RequestContext
from cab.models import Snippet
@@ -25,7 +26,9 @@ def add_snippet(request):
else:
form = SnippetForm()
return render_to_response('cab/snippet_form.html',
- { 'form': form, 'add': True })
+ { 'form': form, 'add': True },
+ context_instance=RequestContext(request))
+
add_snippet = login_required(add_snippet)
@@ -45,6 +48,8 @@ def edit_snippet(request, snippet_id):
else:
form = SnippetForm(instance=snippet)
return render_to_response('cab/snippet_form.html',
- {'form': form, 'add': False})
+ {'form': form, 'add': False},
+ context_instance=RequestContext(request))
+
edit_snippet = login_required(edit_snippet)

0 comments on commit 5e81278

Please sign in to comment.
Something went wrong with that request. Please try again.