Skip to content

Commit

Permalink
fix: pin bleach to version <5
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-hulski authored and jerivas committed Apr 12, 2022
1 parent 11e843d commit 0c3d09f
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion mezzanine/accounts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Meta:
model = get_profile_model()
exclude = (get_profile_user_fieldname(),) + _exclude_fields


except ProfileNotConfigured:
pass

Expand Down
1 change: 0 additions & 1 deletion mezzanine/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Media:
"all": (static("mezzanine/css/admin/tabbed_translation_fields.css"),),
}


else:

class BaseTranslationModelAdmin(admin.ModelAdmin):
Expand Down
1 change: 0 additions & 1 deletion mezzanine/core/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def __init__(self, *args, **kwargs):
kwargs.pop(fb_arg, None)
super().__init__(*args, **kwargs)


else:

class FileField(FileBrowseField):
Expand Down
2 changes: 1 addition & 1 deletion mezzanine/core/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion mezzanine/core/templatetags/mezzanine_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def compress(parser, token):

return compress(parser, token)


else:

@register.to_end_tag
Expand Down
1 change: 0 additions & 1 deletion mezzanine/utils/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
class HTMLParseError(Exception):
pass


except ImportError: # Python 2
from HTMLParser import HTMLParser, HTMLParseError
from htmlentitydefs import name2codepoint
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ install_requires =
django-contrib-comments >= 2.0
django >= 2.2
tzlocal >= 2
bleach >= 2
bleach >= 2, <5
beautifulsoup4 >= 4.5.3
requests >= 2.1.0
requests-oauthlib >= 1.3
Expand All @@ -59,7 +59,7 @@ testing =
pytest-cov >= 2, < 3
codestyle =
flake8 >= 3, <4
black==20.8b1
black == 22.3.0
isort >= 5, <6
pyupgrade >= 2, <3

Expand Down
4 changes: 2 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ def test_static_proxy_with_static_url_with_full_host(self):

def _get_csrftoken(self, response):
csrf = re.findall(
br'<input type="hidden" name="csrfmiddlewaretoken" ' br'value="([^"]+)">',
rb'<input type="hidden" name="csrfmiddlewaretoken" ' rb'value="([^"]+)">',
response.content,
)
self.assertEqual(len(csrf), 1, "No csrfmiddlewaretoken found!")
return csrf[0]

def _get_formurl(self, response):
action = re.findall(br'<form action="([^"]*)" method="post">', response.content)
action = re.findall(rb'<form action="([^"]*)" method="post">', response.content)
self.assertEqual(len(action), 1, "No form with action found!")
if action[0] == b"":
action = response.request["PATH_INFO"]
Expand Down

0 comments on commit 0c3d09f

Please sign in to comment.