Skip to content

Commit

Permalink
www/py-django-bleach: Update to 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sunpoet committed Aug 21, 2023
1 parent 36dcf27 commit 9638dd0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 23 deletions.
5 changes: 2 additions & 3 deletions www/py-django-bleach/Makefile
@@ -1,6 +1,5 @@
PORTNAME= django-bleach
PORTVERSION= 3.0.1
PORTREVISION= 2
PORTVERSION= 3.1.0
CATEGORIES= www python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -12,7 +11,7 @@ WWW= https://github.com/marksweb/django-bleach
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= ${PY_SETUPTOOLS} \
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}bleach>=5:www/py-bleach@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}django32>=3.2:www/py-django32@${PY_FLAVOR}
Expand Down
6 changes: 3 additions & 3 deletions www/py-django-bleach/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1665647979
SHA256 (django-bleach-3.0.1.tar.gz) = 0e5f145bca1a52e822097853403832d92e957e4a1d47bb90233de9d07219247b
SIZE (django-bleach-3.0.1.tar.gz) = 22219
TIMESTAMP = 1692211821
SHA256 (django-bleach-3.1.0.tar.gz) = 766405a32b877a5beb6b377ace0d8bbe2a7d4d6304f04542aa14fd74b14398a7
SIZE (django-bleach-3.1.0.tar.gz) = 22197
74 changes: 57 additions & 17 deletions www/py-django-bleach/files/patch-bleach6
@@ -1,24 +1,64 @@
--- django_bleach/tests/test_forms.py.orig 2022-10-12 00:33:48 UTC
--- django_bleach/tests/test_forms.py.orig 2023-08-05 01:36:02 UTC
+++ django_bleach/tests/test_forms.py
@@ -147,7 +147,7 @@ class TestCustomWidget(TestCase):
@@ -127,7 +127,7 @@ class TestCustomWidget(TestCase):
# Define form inside function with overridden settings so
# get_default_widget() sees the modified setting.
no_tags = BleachField(
max_length=100,
strip_tags=True,
- allowed_tags=[]
+ allowed_tags={}
- max_length=100, strip_tags=True, allowed_tags=[]
+ max_length=100, strip_tags=True, allowed_tags={}
)
no_strip = BleachField(
max_length=100,
--- testproject/models.py.orig 2022-10-12 00:33:48 UTC
max_length=100, allowed_tags=None, allowed_attributes=None
--- setup.py.orig 2023-08-05 01:36:02 UTC
+++ setup.py
@@ -43,7 +43,7 @@ setup(
license="MIT",
packages=find_packages(exclude=("testproject*",)),
install_requires=[
- "bleach[css]>=5,<6",
+ "bleach[css]>=5",
"Django>=3.2",
],
python_requires=">=3.8",
--- testproject/constants.py.orig 2023-08-05 01:36:02 UTC
+++ testproject/constants.py
@@ -2,11 +2,11 @@ ALLOWED_ATTRIBUTES = {"*": ["class", "style"], "a": ["

ALLOWED_CSS_PROPERTIES = ["color"]

-ALLOWED_PROTOCOLS = [
+ALLOWED_PROTOCOLS = {
"https",
"data",
-]
+}

ALLOWED_STYLES = ALLOWED_CSS_PROPERTIES

-ALLOWED_TAGS = ["a", "li", "ul"]
+ALLOWED_TAGS = {"a", "li", "ul"}
--- testproject/forms.py.orig 2023-08-05 01:36:02 UTC
+++ testproject/forms.py
@@ -23,7 +23,7 @@ class CustomBleachWidget(forms.Textarea):
class BleachForm(forms.Form):
"""Form for testing BleachField"""

- no_tags = BleachField(max_length=100, strip_tags=True, allowed_tags=[])
+ no_tags = BleachField(max_length=100, strip_tags=True, allowed_tags={})

no_strip = BleachField(
max_length=100, allowed_tags=None, allowed_attributes=None
--- testproject/models.py.orig 2023-08-05 01:36:02 UTC
+++ testproject/models.py
@@ -10,8 +10,8 @@ class Person(models.Model):
@@ -10,9 +10,9 @@ class Person(models.Model):
biography = BleachField(
max_length=100,
verbose_name='Person biography',
- allowed_tags=['p', 'a', 'li', 'ul', 'strong'],
+ allowed_tags={'p', 'a', 'li', 'ul', 'strong'},
allowed_attributes=['class', 'href', 'style'],
- allowed_protocols=['http', 'https'],
+ allowed_protocols={'http', 'https'},
css_sanitizer=CSSSanitizer(allowed_css_properties=['color', 'background-color'])
)
verbose_name="Person biography",
- allowed_tags=["p", "a", "li", "ul", "strong"],
+ allowed_tags={"p", "a", "li", "ul", "strong"},
allowed_attributes=["class", "href", "style"],
- allowed_protocols=["http", "https"],
+ allowed_protocols={"http", "https"},
css_sanitizer=CSSSanitizer(
allowed_css_properties=["color", "background-color"]
),

0 comments on commit 9638dd0

Please sign in to comment.