# Path: bundestagger/helper/utils.py
# def is_post(func):
#     return is_method("POST", func)
# 
# Path: bundestagger/account/auth.py
# def logged_in(func):
#     def loggedin_func(*args, **kwargs):
#         request = args[0]
#         if "bundesuser" in request.session:
#             request.bundesuser = request.session["bundesuser"]
#             return func(*args, **kwargs)
#         raise PermissionDenied
#     return loggedin_func
# 
# 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.http import Http404, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed
from django.shortcuts import redirect
from django.contrib import messages
from bundestagger.helper.utils import is_post
from bundestagger.account.auth import logged_in
from bundestagger.account.models import User
    from bundestagger.account.auth import logout as logout_func
# -*- coding: utf-8 -*-


@is_post
def logout(request):
    logout_func(request)
    next = "/"
    if "next" in request.POST:
        next = request.POST["next"]
    return redirect(next)


# Path: bundestagger/helper/utils.py
# def is_post(func):
#     return is_method("POST", func)
# 
# Path: bundestagger/account/auth.py
# def logged_in(func):
#     def loggedin_func(*args, **kwargs):
#         request = args[0]
#         if "bundesuser" in request.session:
#             request.bundesuser = request.session["bundesuser"]
#             return func(*args, **kwargs)
#         raise PermissionDenied
#     return loggedin_func
# 
# 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/views.py
from django.http import Http404, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotAllowed
from django.shortcuts import redirect
from django.contrib import messages
from bundestagger.helper.utils import is_post
from bundestagger.account.auth import logged_in
from bundestagger.account.models import User
    from bundestagger.account.auth import logout as logout_func

# -*- coding: utf-8 -*-


@is_post
def logout(request):
    logout_func(request)
    next = "/"
    if "next" in request.POST:
        next = request.POST["next"]
    return redirect(next)


@is_post