From 59a44a2eb91ea96cb98ffbc950d70d3a303c8485 Mon Sep 17 00:00:00 2001
From: Arnaud-D <35631001+Arnaud-D@users.noreply.github.com>
Date: Wed, 1 Nov 2023 16:12:19 +0100
Subject: [PATCH 1/4] Supprime des fonctions inutiles (#6547)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Supprime la fonction inutilisée get_opinion_count
* Supprime la fonction inutilisée get_tuto_count
* Supprime la fonction inutilisée get_article_count
* Supprime la fonction inutilisée get_content_counts
---
zds/member/models.py | 27 ---------------------------
zds/member/tests/tests_models.py | 22 ----------------------
2 files changed, 49 deletions(-)
diff --git a/zds/member/models.py b/zds/member/models.py
index 2c8b50a049..5c0ff057d0 100644
--- a/zds/member/models.py
+++ b/zds/member/models.py
@@ -185,15 +185,6 @@ def get_user_beta_contents_queryset(self, _type=None):
"""
return self.get_user_contents_queryset(_type).filter(sha_beta__isnull=False)
- def get_content_count(self, _type=None):
- """
- :param _type: if provided, request a specific type of content
- :return: the count of contents with this user as author. Count all contents no only published one.
- """
- if self.is_private():
- return 0
- return self.get_user_contents_queryset(_type).count()
-
def get_contents(self, _type=None):
"""
:param _type: if provided, request a specific type of content
@@ -231,12 +222,6 @@ def get_beta_contents(self, _type=None):
"""
return self.get_user_beta_contents_queryset(_type).all()
- def get_tuto_count(self):
- """
- :return: the count of tutorials with this user as author. Count all tutorials, no only published one.
- """
- return self.get_content_count(_type="TUTORIAL")
-
def get_tutos(self):
"""
:return: All tutorials with this user as author.
@@ -269,12 +254,6 @@ def get_beta_tutos(self):
"""
return self.get_beta_contents(_type="TUTORIAL")
- def get_article_count(self):
- """
- :return: the count of articles with this user as author. Count all articles, no only published one.
- """
- return self.get_content_count(_type="ARTICLE")
-
def get_articles(self):
"""
:return: All articles with this user as author.
@@ -307,12 +286,6 @@ def get_beta_articles(self):
"""
return self.get_beta_contents(_type="ARTICLE")
- def get_opinion_count(self):
- """
- :return: the count of opinions with this user as author. Count all opinions, no only published one.
- """
- return self.get_content_count(_type="OPINION")
-
def get_opinions(self):
"""
:return: All opinions with this user as author.
diff --git a/zds/member/tests/tests_models.py b/zds/member/tests/tests_models.py
index 8f5d0c1532..c21c30b114 100644
--- a/zds/member/tests/tests_models.py
+++ b/zds/member/tests/tests_models.py
@@ -62,17 +62,6 @@ def test_get_topic_count(self):
# Should be 1
self.assertEqual(self.user1.get_topic_count(), 1)
- def test_get_tuto_count(self):
- # Start with 0
- self.assertEqual(self.user1.get_tuto_count(), 0)
- # Create Tuto !
- minituto = PublishableContentFactory(type="TUTORIAL")
- minituto.authors.add(self.user1.user)
- minituto.gallery = GalleryFactory()
- minituto.save()
- # Should be 1
- self.assertEqual(self.user1.get_tuto_count(), 1)
-
def test_get_tutos(self):
# Start with 0
self.assertEqual(len(self.user1.get_tutos()), 0)
@@ -140,17 +129,6 @@ def test_get_beta_tutos(self):
self.assertEqual(len(betatetutos), 1)
self.assertEqual(betatetuto, betatetutos[0])
- def test_get_article_count(self):
- # Start with 0
- self.assertEqual(self.user1.get_tuto_count(), 0)
- # Create article !
- minituto = PublishableContentFactory(type="ARTICLE")
- minituto.authors.add(self.user1.user)
- minituto.gallery = GalleryFactory()
- minituto.save()
- # Should be 1
- self.assertEqual(self.user1.get_article_count(), 1)
-
def test_get_articles(self):
# Start with 0
self.assertEqual(len(self.user1.get_articles()), 0)
From 5022f95eded39d52afa599ed043e7be5f0f5b88a Mon Sep 17 00:00:00 2001
From: Arnaud-D <35631001+Arnaud-D@users.noreply.github.com>
Date: Wed, 1 Nov 2023 16:27:30 +0100
Subject: [PATCH 2/4] =?UTF-8?q?Corrige=20le=20d=C3=A9calage=20du=20bouton?=
=?UTF-8?q?=20"Signaler=20le=20contenu"=20dans=20les=20billets=20(#6549)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
templates/tutorialv2/view/content.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/templates/tutorialv2/view/content.html b/templates/tutorialv2/view/content.html
index 7a65e743d0..17b7527511 100644
--- a/templates/tutorialv2/view/content.html
+++ b/templates/tutorialv2/view/content.html
@@ -109,13 +109,13 @@
{% include "tutorialv2/includes/content/content_pager.part.html" with content=content %}
{% endif %}
- {% if display_config.info_config.show_warn_typo %}
- {% include "tutorialv2/includes/content/warn_typo.part.html" with content=content %}
- {% endif %}
-
{% if display_config.alerts_config.show_alert_button %}
{% include "tutorialv2/includes/alert.html" with content=content current_content_type=current_content_type %}
{% endif %}
+
+ {% if display_config.info_config.show_warn_typo %}
+ {% include "tutorialv2/includes/content/warn_typo.part.html" with content=content %}
+ {% endif %}
{% endblock %}
From 630f5e3dd2bc23c7904994adc9fb590a33525ab9 Mon Sep 17 00:00:00 2001
From: "Ph. SW"
- {% trans "Comment souhaitez vous retrouvez votre mot de passe ?" %} + {% trans "Comment souhaitez-vous retrouver votre mot de passe ?" %}