Browse Source

Merge branch 'fix_247' into 'dev'

Fix 247

See merge request re2o/re2o!497
fix_244
Jean-Romain Garnier 6 years ago
parent
commit
614538eefe
  1. 15
      users/models.py

15
users/models.py

@ -1394,14 +1394,15 @@ class Adherent(User):
:return: a message and a boolean which is True if the user can create :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. 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:
"self_adhesion" if not OptionalUser.get_cached_value(
): "self_adhesion"
return False, _("Self registration is disabled."), None ):
return False, _("Self registration is disabled."), None
else:
return True, None, None
else: else:
if OptionalUser.get_cached_value( if OptionalUser.get_cached_value("all_can_create_adherent"):
"all_can_create_adherent"
) or OptionalUser.get_cached_value("self_adhesion"):
return True, None, None return True, None, None
else: else:
can = user_request.has_perm("users.add_user") can = user_request.has_perm("users.add_user")

Loading…
Cancel
Save