@wraps(view_func)
def _checklogin(request, *args, **kwargs):
    if request.user.is_active and request.user.is_staff:
        return view_func(request, *args, **kwargs)
How to set django upload_handler in admin?