Clean up User Model and User profile edit view now that soc.logic.site.id_user
module exists. Change usage of "user" to be "id" the variable refers to a
Google Account and not a User entity.
Patch by: Todd Larsen
Review by: to-be-reviewed
class LazyUser(object):
def __get__(self, request, obj_type=None):
if not hasattr(request, '_cached_user'):
from django.contrib.auth import get_user
request._cached_user = get_user(request)
return request._cached_user
class AuthenticationMiddleware(object):
def process_request(self, request):
assert hasattr(request, 'session'), "The Django authentication middleware requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'."
request.__class__.user = LazyUser()
return None