def admin_required(function):

    def wrap(request, *args, **kwargs):
        if (not request.user.groups.filter(name='Administrador').exists()):
            return redirect('')
        return function(request, *args, **kwargs)
    return wrap
def admin_required(function):

    def wrap(request, *args, **kwargs):
        if (not request.user.groups.filter(name='Administrador').exists()):
            return redirect()
        return function(request, *args, **kwargs)
    return wrap