Skip to content

Commit

Permalink
quality
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed May 28, 2024
1 parent febff31 commit 08f5718
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lacommunaute/notification/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ def collect_following_replies():
topic.get_absolute_url(with_fqdn=True),
topic.subject,
topic.mails_to_notify(),
f"{topic.new_replies} nouvelle réponse"
if topic.new_replies == 1
else f"{topic.new_replies} nouvelles réponses",
(
f"{topic.new_replies} nouvelle réponse"
if topic.new_replies == 1
else f"{topic.new_replies} nouvelles réponses"
),
)
for topic in Topic.objects.with_following_replies(last_notification(kind=EmailSentTrackKind.FOLLOWING_REPLIES))
]
Expand Down
1 change: 1 addition & 0 deletions lacommunaute/utils/templatetags/str_filters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/
"""

from django import template
from django.template.defaultfilters import stringfilter
from django.urls import reverse
Expand Down
1 change: 1 addition & 0 deletions lacommunaute/utils/templatetags/theme_inclusion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
https://docs.djangoproject.com/en/dev/howto/custom-template-tags/
"""

from django import template
from django.templatetags.static import static
from django.utils.safestring import mark_safe
Expand Down
8 changes: 5 additions & 3 deletions lacommunaute/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ def parse_response_to_soup(response, selector=None, no_html_body=False, replace_
csp_nonce_script["nonce"] = "NORMALIZED_CSP_NONCE"
if replace_in_href:
replacements = [
replacement
if isinstance(replacement, tuple)
else (str(replacement.pk), f"[PK of {type(replacement).__name__}]")
(
replacement
if isinstance(replacement, tuple)
else (str(replacement.pk), f"[PK of {type(replacement).__name__}]")
)
for replacement in replace_in_href
]
for links in soup.find_all(attrs={"href": True}):
Expand Down

0 comments on commit 08f5718

Please sign in to comment.