Commit 6f1ccaf3 authored by Levy--Falk Hugo's avatar Levy--Falk Hugo

Pas de redondance dans les droits hérités sur Club et Adherent

parent f6130c23
......@@ -18,7 +18,7 @@ class Migration(migrations.Migration):
operations = [
migrations.AlterModelOptions(
name='adherent',
options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'member', 'verbose_name_plural': 'members'},
options={'verbose_name': 'member', 'verbose_name_plural': 'members'},
),
migrations.AlterModelOptions(
name='ban',
......@@ -26,7 +26,7 @@ class Migration(migrations.Migration):
),
migrations.AlterModelOptions(
name='club',
options={'permissions': (('change_user_password', 'Can change the password of a user'), ('change_user_state', 'Can edit the state of a user'), ('change_user_force', 'Can force the move'), ('change_user_shell', 'Can edit the shell of a user'), ('change_user_groups', 'Can edit the groups of rights of a user (critical permission)'), ('change_all_users', 'Can edit all users, including those with rights.'), ('view_user', 'Can view a user object')), 'verbose_name': 'club', 'verbose_name_plural': 'clubs'},
options={'verbose_name': 'club', 'verbose_name_plural': 'clubs'},
),
migrations.AlterModelOptions(
name='emailaddress',
......
......@@ -1027,21 +1027,7 @@ class Adherent(User):
)]
)
class Meta:
permissions = (
("change_user_password",
_("Can change the password of a user")),
("change_user_state", _("Can edit the state of a user")),
("change_user_force", _("Can force the move")),
("change_user_shell", _("Can edit the shell of a user")),
("change_user_groups",
_("Can edit the groups of rights of a user (critical"
" permission)")),
("change_all_users",
_("Can edit all users, including those with rights.")),
("view_user",
_("Can view a user object")),
)
class Meta(User.Meta):
verbose_name = _("member")
verbose_name_plural = _("members")
......@@ -1100,21 +1086,7 @@ class Club(User):
default=False
)
class Meta:
permissions = (
("change_user_password",
_("Can change the password of a user")),
("change_user_state", _("Can edit the state of a user")),
("change_user_force", _("Can force the move")),
("change_user_shell", _("Can edit the shell of a user")),
("change_user_groups",
_("Can edit the groups of rights of a user (critical"
" permission)")),
("change_all_users",
_("Can edit all users, including those with rights.")),
("view_user",
_("Can view a user object")),
)
class Meta(User.Meta):
verbose_name = _("club")
verbose_name_plural = _("clubs")
......@@ -1847,7 +1819,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
if self.local_part == self.user.pseudo.lower():
return False, _("You can't delete a local email account whose"
" local part is the same as the username.")
if user_request.has_perm('users.delete_emailaddress'):
if user_request.has_perm('users.delete_emailaddress'):
return True, None
if not OptionalUser.get_cached_value('local_email_accounts_enabled'):
return False, _("The local email accounts are not enabled.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment