from django.http import HttpResponseForbidden


def admin_required(function):

    def wrapper(request, *args, **kwargs):
        try:
            if request.user.role != 1:
                return HttpResponseForbidden('403 Forbidden')
            return function(request, *args, **kwargs)
        except:
            return HttpResponseForbidden('403 Forbidden')
    return wrapper

7ed5dfba8eccfcea55b54001b5c598e0d220e0e3
<mask token>

<mask token>


def admin_required(function):

    def wrapper(request, *args, **kwargs):
        try:
            if request.user.role != 1:
                return HttpResponseForbidden('403 Forbidden')
            return function(request, *args, **kwargs)
        except:
            return HttpResponseForbidden('403 Forbidden')
    return wrapper

from django.http import HttpResponseForbidden


def admin_required(function):

    def wrapper(request, *args, **kwargs):
        try:
            if request.user.role != 1:
                return HttpResponseForbidden('403 Forbidden')
            return function(request, *args, **kwargs)
        except:
            return HttpResponseForbidden('403 Forbidden')
    return wrapper
