8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

Rend can_change_shell de User cast-proof

This commit is contained in:
Hugo LEVY-FALK 2018-08-15 23:14:30 +02:00
parent ba31a94c20
commit 1e47fa16a0

View file

@ -839,7 +839,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
:returns: a message and a boolean which is True if the user has
the right to change a shell
"""
if not ((self == user_request and OptionalUser.get_cached_value('self_change_shell'))
if not ((self.pk == user_request.pk and OptionalUser.get_cached_value('self_change_shell'))
or user_request.has_perm('users.change_user_shell')):
return False, u"Droit requis pour changer le shell"
else: