def logout(request): if users.get_current_user(): return HttpResponseRedirect(users.create_logout_url('/')) user = session.get('user', None) if user: del(session['user']) return HttpResponseRedirect('/')
def get_user(): who = users.get_current_user() if who: #django user user = User.all().filter('user = '******'user') return user
def __get__(self, request, obj_type=None): if not hasattr(request, '_cached_user'): user = users.get_current_user() if user: request._cached_user = User.get_djangouser_for_user(user) else: user = session.get('user', None) if user: request._cached_user = user else: request._cached_user = AnonymousUser() return request._cached_user