# Path: bundestagger/account/models.py
# class User(models.Model):
#     openid = models.CharField(blank=True, max_length=255)
#     ipaddress = models.IPAddressField(blank=True, null=True)
#     username = models.CharField(null=True, blank=True, max_length=30)
#     level = models.IntegerField(default=0)
#     last_seen = models.DateTimeField(auto_now=True)
#     
#     def __unicode__(self):
#         return self.username
# 
#     @property
#     def is_moderator(self):
#         return self.level >= EDIT_LEVEL
# 
#     @property
#     def is_admin(self):
#         return self.level >= SUPER_LEVEL


from django.core.exceptions import PermissionDenied
from bundestagger.account.models import User

def get_user(request):
    if "bundesuser" in request.session:
        return request.session["bundesuser"]
    return None

def login(request, openid):
    try:
        user = User.objects.get(openid=openid)

# Path: bundestagger/account/models.py
# class User(models.Model):
#     openid = models.CharField(blank=True, max_length=255)
#     ipaddress = models.IPAddressField(blank=True, null=True)
#     username = models.CharField(null=True, blank=True, max_length=30)
#     level = models.IntegerField(default=0)
#     last_seen = models.DateTimeField(auto_now=True)
#     
#     def __unicode__(self):
#         return self.username
# 
#     @property
#     def is_moderator(self):
#         return self.level >= EDIT_LEVEL
# 
#     @property
#     def is_admin(self):
#         return self.level >= SUPER_LEVEL


# Path: bundestagger/account/auth.py
from django.core.exceptions import PermissionDenied
from bundestagger.account.models import User


def get_user(request):
    if "bundesuser" in request.session:
        return request.session["bundesuser"]
    return None

def login(request, openid):
    try:
        user = User.objects.get(openid=openid)

    except User.DoesNotExist: