Last active
August 29, 2015 14:09
-
-
Save manevant/5f9a84d4f88c476423dd to your computer and use it in GitHub Desktop.
Тройное отрицание
This file contains hidden or 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
| if not article.is_visible or not article.is_moderate: | |
| is_author = article.author == request.user | |
| if request.user.is_admin or request.user.is_staff or is_author: | |
| pass | |
| else: | |
| raise PermissionDenied | |
| #EDITED | |
| if not article.is_visible or not article.is_moderate: | |
| is_author = article.author == request.user | |
| if not (request.user.is_admin or request.user.is_staff or is_author): | |
| raise PermissionDenied |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment