From 5c433acd792f523aefc945e114f2e170d0356c16 Mon Sep 17 00:00:00 2001 From: grisel-davy Date: Sat, 30 Jun 2018 22:56:34 +0200 Subject: [PATCH] bug fix historique alias --- users/admin.py | 6 ++++++ users/models.py | 4 ++-- .../templates/users/{aff_alias.html => aff_mailalias.html} | 2 +- users/templates/users/profil.html | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) rename users/templates/users/{aff_alias.html => aff_mailalias.html} (97%) diff --git a/users/admin.py b/users/admin.py index 92528455..ce02aa09 100644 --- a/users/admin.py +++ b/users/admin.py @@ -110,6 +110,11 @@ class BanAdmin(VersionAdmin): pass +class MailAliasAdmin(VersionAdmin): + """Gestion des alias mail""" + pass + + class WhitelistAdmin(VersionAdmin): """Gestion des whitelist""" pass @@ -211,6 +216,7 @@ admin.site.register(School, SchoolAdmin) admin.site.register(ListRight, ListRightAdmin) admin.site.register(ListShell, ListShellAdmin) admin.site.register(Ban, BanAdmin) +admin.site.register(MailAlias, MailAliasAdmin) admin.site.register(Whitelist, WhitelistAdmin) admin.site.register(Request, RequestAdmin) # Now register the new UserAdmin... diff --git a/users/models.py b/users/models.py index ba7fda3a..91995d61 100644 --- a/users/models.py +++ b/users/models.py @@ -1677,7 +1677,7 @@ class MailAlias(RevMixin, AclMixin, models.Model): """ Define a alias for a user Mail - Définit un aliase pour un Mail d'utilisateur + Définit un alias pour un Mail d'utilisateur """ mail = models.ForeignKey( 'Mail', @@ -1713,7 +1713,7 @@ class MailAlias(RevMixin, AclMixin, models.Model): def can_view(self, user_request, *_args, **_kwargs): """ - Check if the user can view the aliases + Check if the user can view the alias """ if user_request.has_perm('users.view_mailalias') or user.request == self.user: diff --git a/users/templates/users/aff_alias.html b/users/templates/users/aff_mailalias.html similarity index 97% rename from users/templates/users/aff_alias.html rename to users/templates/users/aff_mailalias.html index ec5b7313..a441b9e9 100644 --- a/users/templates/users/aff_alias.html +++ b/users/templates/users/aff_mailalias.html @@ -41,7 +41,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% can_edit alias %} {% include 'buttons/edit.html' with href='users:edit-mailalias' id=alias.id %} {% acl_end %} - {% include 'buttons/history.html' with href='users:history' name='alias' id=alias.id %} + {% include 'buttons/history.html' with href='users:history' name='mailalias' id=alias.id %} {% endfor %} diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index b6e3c848..2a67934a 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -447,7 +447,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% acl_end %} {% if alias_list %} - {% include "users/aff_alias.html" with alias_list=alias_list %} + {% include "users/aff_mailalias.html" with alias_list=alias_list %} {% endif %} {% endif %} {% else %}