From 7d3f841f2b6133502c80b48e908570d4bf64b4f6 Mon Sep 17 00:00:00 2001 From: Henri Hulski Date: Fri, 8 Apr 2022 18:58:55 +0200 Subject: [PATCH] style: run black with upgraded version --- mezzanine/accounts/forms.py | 1 - mezzanine/core/admin.py | 1 - mezzanine/core/fields.py | 1 - mezzanine/core/managers.py | 2 +- mezzanine/core/templatetags/mezzanine_tags.py | 1 - mezzanine/utils/html.py | 1 - tests/test_core.py | 4 ++-- 7 files changed, 3 insertions(+), 8 deletions(-) diff --git a/mezzanine/accounts/forms.py b/mezzanine/accounts/forms.py index 7551e9037c..93e35b9622 100644 --- a/mezzanine/accounts/forms.py +++ b/mezzanine/accounts/forms.py @@ -31,7 +31,6 @@ class Meta: model = get_profile_model() exclude = (get_profile_user_fieldname(),) + _exclude_fields - except ProfileNotConfigured: pass diff --git a/mezzanine/core/admin.py b/mezzanine/core/admin.py index aa7cdfc521..26eb7ba4ec 100644 --- a/mezzanine/core/admin.py +++ b/mezzanine/core/admin.py @@ -47,7 +47,6 @@ class Media: "all": (static("mezzanine/css/admin/tabbed_translation_fields.css"),), } - else: class BaseTranslationModelAdmin(admin.ModelAdmin): diff --git a/mezzanine/core/fields.py b/mezzanine/core/fields.py index 72928961d8..e82c752fe9 100644 --- a/mezzanine/core/fields.py +++ b/mezzanine/core/fields.py @@ -112,7 +112,6 @@ def __init__(self, *args, **kwargs): kwargs.pop(fb_arg, None) super().__init__(*args, **kwargs) - else: class FileField(FileBrowseField): diff --git a/mezzanine/core/managers.py b/mezzanine/core/managers.py index d835cf7c8b..bee4b8fa6e 100644 --- a/mezzanine/core/managers.py +++ b/mezzanine/core/managers.py @@ -247,7 +247,7 @@ def annotate_scores(self): if result.publish_date: age = (now() - result.publish_date).total_seconds() if age > 0: - count = count / age ** settings.SEARCH_AGE_SCALE_FACTOR + count = count / age**settings.SEARCH_AGE_SCALE_FACTOR results[i].result_count = count return iter(results) diff --git a/mezzanine/core/templatetags/mezzanine_tags.py b/mezzanine/core/templatetags/mezzanine_tags.py index 93a883d8cb..8a7afb3b32 100644 --- a/mezzanine/core/templatetags/mezzanine_tags.py +++ b/mezzanine/core/templatetags/mezzanine_tags.py @@ -52,7 +52,6 @@ def compress(parser, token): return compress(parser, token) - else: @register.to_end_tag diff --git a/mezzanine/utils/html.py b/mezzanine/utils/html.py index 8734c5405a..049b2ca3f4 100644 --- a/mezzanine/utils/html.py +++ b/mezzanine/utils/html.py @@ -9,7 +9,6 @@ class HTMLParseError(Exception): pass - except ImportError: # Python 2 from HTMLParser import HTMLParser, HTMLParseError from htmlentitydefs import name2codepoint diff --git a/tests/test_core.py b/tests/test_core.py index 24e181f0da..3f4f8510fc 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -309,14 +309,14 @@ def test_static_proxy_with_static_url_with_full_host(self): def _get_csrftoken(self, response): csrf = re.findall( - br'', + rb'', response.content, ) self.assertEqual(len(csrf), 1, "No csrfmiddlewaretoken found!") return csrf[0] def _get_formurl(self, response): - action = re.findall(br'
', response.content) + action = re.findall(rb'', response.content) self.assertEqual(len(action), 1, "No form with action found!") if action[0] == b"": action = response.request["PATH_INFO"]