-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empeche un staff de se sanctionner lui-meme #2850
Conversation
Le cacher dans le template c'est bien, mais coté back-end ce n'est pas interdit, ça signifie que c'est potentiellement faisable via l'API par exemple. |
Ah oui c'est tres vrai ca |
|
@@ -428,6 +428,9 @@ def modify_profile(request, user_pk): | |||
profile = get_object_or_404(Profile, user__pk=user_pk) | |||
if profile.is_private(): | |||
raise PermissionDenied | |||
if request.user.profile == profile: | |||
messages.error(request, u"Vous ne pouvez pas vous sanctionner vous-même !") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internationalisation !
|
Voili voilou, le site et l'API ont le meme comportement :) |
Rapport de QA; ok pour moi, cette fois :) |
Empeche un staff de se sanctionner lui-meme
Un staff ne peut plus se sanctionner lui-meme par accident.
QA
Verifier qu'un staff peut bien sanctionner tout le monde (ban, LS) (sauf les robots) mais pas lui-meme.
Verifier via l'API serait bien aussi...