mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 07:02:26 +00:00
Fix #247
This commit is contained in:
parent
51c81886b5
commit
2f7c77fd9f
1 changed files with 8 additions and 7 deletions
|
@ -1394,14 +1394,15 @@ class Adherent(User):
|
|||
:return: a message and a boolean which is True if the user can create
|
||||
a user or if the `options.all_can_create` is set.
|
||||
"""
|
||||
if not user_request.is_authenticated and not OptionalUser.get_cached_value(
|
||||
if not user_request.is_authenticated:
|
||||
if not OptionalUser.get_cached_value(
|
||||
"self_adhesion"
|
||||
):
|
||||
return False, _("Self registration is disabled."), None
|
||||
else:
|
||||
if OptionalUser.get_cached_value(
|
||||
"all_can_create_adherent"
|
||||
) or OptionalUser.get_cached_value("self_adhesion"):
|
||||
return True, None, None
|
||||
else:
|
||||
if OptionalUser.get_cached_value("all_can_create_adherent"):
|
||||
return True, None, None
|
||||
else:
|
||||
can = user_request.has_perm("users.add_user")
|
||||
|
|
Loading…
Reference in a new issue