Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't overwrite non-authenticated user object in template tag.

  • Loading branch information...
commit 38e29e530826c0f19356d3b3f440e98c3953eab3 1 parent fc6afa3
Filip Wasilewski authored March 06, 2012

Showing 1 changed file with 0 additions and 3 deletions. Show diff stats Hide diff stats

  1. 3  rulez/templatetags/rulez_perms.py
3  rulez/templatetags/rulez_perms.py
... ...
@@ -1,5 +1,4 @@
1 1
 from django import template
2  
-from django.contrib.auth.models import AnonymousUser
3 2
 
4 3
 register = template.Library()
5 4
 
@@ -12,8 +11,6 @@ def __init__(self, codename, objname, varname):
12 11
     def render(self, context):
13 12
         user_obj = template.resolve_variable('user', context)
14 13
         obj = template.resolve_variable(self.objname, context)
15  
-        if not user_obj.is_authenticated():
16  
-            user_obj = AnonymousUser()
17 14
         context[self.varname] = user_obj.has_perm(self.codename, obj)
18 15
         return ''
19 16
 

0 notes on commit 38e29e5

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