Created
July 19, 2018 17:16
-
-
Save octaflop/931a883bdd1c39f70b7e266d5d1bdf04 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def active_user_required(view_func): | |
@wraps(view_func) | |
def inner(request, *args, **kwargs): | |
if request.user.is_active: | |
return view_func(request, *args, **kwargs) | |
raise Http404() | |
return inner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment