Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1582 -- Converted AnonymousUser functions to de…

…scriptor style

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4b37f265adc10a39960f049095976170590d015c 1 parent 356c2e7
Adrian Holovaty authored April 11, 2006

Showing 1 changed file with 9 additions and 12 deletions. Show diff stats Hide diff stats

  1. 21  django/contrib/auth/models.py
21  django/contrib/auth/models.py
@@ -148,9 +148,9 @@ def get_group_permissions(self):
148 148
                     AND ug.%s = %%s""" % (
149 149
                 backend.quote_name('app_label'), backend.quote_name('codename'),
150 150
                 backend.quote_name('auth_permission'), backend.quote_name('auth_group_permissions'),
151  
-                backend.quote_name('auth_user_groups'), backend.quote_name('django_content_type'), 
152  
-                backend.quote_name('id'), backend.quote_name('permission_id'), 
153  
-                backend.quote_name('group_id'), backend.quote_name('group_id'), 
  151
+                backend.quote_name('auth_user_groups'), backend.quote_name('django_content_type'),
  152
+                backend.quote_name('id'), backend.quote_name('permission_id'),
  153
+                backend.quote_name('group_id'), backend.quote_name('group_id'),
154 154
                 backend.quote_name('id'), backend.quote_name('content_type_id'),
155 155
                 backend.quote_name('user_id'),)
156 156
             cursor.execute(sql, [self.id])
@@ -225,8 +225,9 @@ class Message(models.Model):
225 225
     def __repr__(self):
226 226
         return self.message
227 227
 
228  
-class AnonymousUser:
  228
+class AnonymousUser(object):
229 229
     id = None
  230
+    username = ''
230 231
 
231 232
     def __init__(self):
232 233
         pass
@@ -246,17 +247,13 @@ def set_password(self, raw_password):
246 247
     def check_password(self, raw_password):
247 248
         raise NotImplementedError
248 249
 
249  
-    def get_group_list(self):
250  
-        return []
251  
-
252  
-    def set_groups(self, group_id_list):
  250
+    def _get_groups(self):
253 251
         raise NotImplementedError
  252
+    groups = property(_get_groups)
254 253
 
255  
-    def get_permission_list(self):
256  
-        return []
257  
-
258  
-    def set_permissions(self, permission_id_list):
  254
+    def _get_user_permissions(self):
259 255
         raise NotImplementedError
  256
+    user_permissions = property(_get_user_permissions)
260 257
 
261 258
     def has_perm(self, perm):
262 259
         return False

0 notes on commit 4b37f26

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