From 4fb6d1471119ce0891a3f18b16dac12091e3ffb7 Mon Sep 17 00:00:00 2001 From: artragis Date: Thu, 17 Oct 2024 22:23:32 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9e=20un=20raccourci=20pour=20que=20les?= =?UTF-8?q?=20modo=20puissent=20supprimer=20les=20mauvais=20domaines=20(#6?= =?UTF-8?q?552)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ph. SW. --- templates/member/profile.html | 17 +++++++++++++++++ zds/member/views/profile.py | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/templates/member/profile.html b/templates/member/profile.html index f88ba71e98..fcdb6d9ff0 100644 --- a/templates/member/profile.html +++ b/templates/member/profile.html @@ -858,6 +858,23 @@

{% trans 'Sanctions' %}

{% trans "Confirmer" %} + {% if provider_to_ban %} + + +

+ {% trans "Bannir le fournisseur email" %} +

+
+ + {% endif %} {% endif %} {% endif %} diff --git a/zds/member/views/profile.py b/zds/member/views/profile.py index 16b0a83aaf..eb8c5d263d 100644 --- a/zds/member/views/profile.py +++ b/zds/member/views/profile.py @@ -199,7 +199,13 @@ def get_context_data(self, **kwargs): context["alerts"] = profile.alerts_on_this_profile.all().order_by("-pubdate") context["has_unsolved_alerts"] = profile.alerts_on_this_profile.filter(solved=False).exists() + if self.request.user.has_perm("user.change_bannedemailprovider"): + new_provider = NewEmailProvider.objects.filter(user=usr).first() + if new_provider is not None: + context["provider_to_ban"] = new_provider + context["summaries"] = self.get_summaries(profile, hide_forum_activity) + return context