Ticket #5783: auth_user_url.diff
File auth_user_url.diff, 1.1 KB (added by , 17 years ago) |
---|
-
conf/global_settings.py
332 332 333 333 LOGIN_REDIRECT_URL = '/accounts/profile/' 334 334 335 AUTH_USERS_URL = '/users/%(username)s/' 336 335 337 ########### 336 338 # TESTING # 337 339 ########### -
contrib/auth/models.py
149 149 return self.username 150 150 151 151 def get_absolute_url(self): 152 return "/users/%s/" % urllib.quote(smart_str(self.username)) 152 from django.conf import settings 153 import re 154 url, url_dict = settings.AUTH_USERS_URL, dict() 155 for attr in re.findall(r'%\(([\w_]+)\)s', url): 156 url_dict[attr] = getattr(self, attr) 157 url = url % url_dict 158 return urllib.quote(smart_str(url)) 153 159 154 160 def is_anonymous(self): 155 161 "Always returns False. This is a way of comparing User objects to anonymous users."