from django.shortcuts import redirect


def login_required(func):
    def wrapper(request,*args,**kwargs):
        if request.user.is_authenticated:
            return func(request,*args,**kwargs)
        else:
            return redirect("userlogin")
    return wrapper

def user_admin(func):
    def wrapper(request,*args,**kwargs):
        if request.user.is_superuser:
            return func(request,*args,**kwargs)
        else:
            return redirect("userlogin")
    return wrapper
20dca485e288187151787b6ec8b198dda013908d
<mask token>

<mask token>


def user_admin(func):

    def wrapper(request, *args, **kwargs):
        if request.user.is_superuser:
            return func(request, *args, **kwargs)
        else:
            return redirect('userlogin')
    return wrapper

<mask token>


def login_required(func):

    def wrapper(request, *args, **kwargs):
        if request.user.is_authenticated:
            return func(request, *args, **kwargs)
        else:
            return redirect('userlogin')
    return wrapper


def user_admin(func):

    def wrapper(request, *args, **kwargs):
        if request.user.is_superuser:
            return func(request, *args, **kwargs)
        else:
            return redirect('userlogin')
    return wrapper

from django.shortcuts import redirect


def login_required(func):

    def wrapper(request, *args, **kwargs):
        if request.user.is_authenticated:
            return func(request, *args, **kwargs)
        else:
            return redirect('userlogin')
    return wrapper


def user_admin(func):

    def wrapper(request, *args, **kwargs):
        if request.user.is_superuser:
            return func(request, *args, **kwargs)
        else:
            return redirect('userlogin')
    return wrapper

from django.shortcuts import redirect


def login_required(func):
    def wrapper(request,*args,**kwargs):
        if request.user.is_authenticated:
            return func(request,*args,**kwargs)
        else:
            return redirect("userlogin")
    return wrapper

def user_admin(func):
    def wrapper(request,*args,**kwargs):
        if request.user.is_superuser:
            return func(request,*args,**kwargs)
        else:
            return redirect("userlogin")
    return wrapper