just showing off, don't merge this!

This commit is contained in:
Jonas Obrist 2012-08-19 01:20:08 +02:00
parent f7938a9dc1
commit 8b988be06e
8 changed files with 7203 additions and 1 deletions

View file

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
from django.utils.functional import SimpleLazyObject
from githubnetwork.models import GHUser
def get_github_user(request):
if not request.user.is_authenticated():
return None
return GHUser.objects.get(user=request.user)
class GithubUserMiddleware(object):
def process_request(self, request):
request.gh_user = SimpleLazyObject(lambda: get_github_user(request))