Commit ab3c305e authored by jaywink's avatar jaywink
Browse files

Prefer python-slugify over unicode-slugify and autoslufigy

It seems the python-slugify from federation conflicted with unicode-slugify, which broke Profile.mxid for remote profiles. Remove the latter, converting code to use python-slugify, which is a more maintained library.
parent ab5934f4
Pipeline #5966 canceled with stages
......@@ -264,9 +264,6 @@ LOGIN_REDIRECT_URL = "home"
LOGIN_URL = "account_login"
LOGOUT_URL = "account_logout"
# SLUGLIFIER
AUTOSLUG_SLUGIFY_FUNCTION = "slugify.slugify"
# REDIS
# -----
REDIS_HOST = env("REDIS_HOST", default="localhost")
......
......@@ -157,8 +157,6 @@ dirty-validators==0.5.4
# federation
django-allauth==0.44.0
# via -r requirements/requirements.txt
django-autoslug==1.9.8
# via -r requirements/requirements.txt
django-braces==1.14.0
# via -r requirements/requirements.txt
django-coverage-plugin==1.8.0
......@@ -588,7 +586,6 @@ six==1.15.0
# pytest-profiling
# python-dateutil
# traitlets
# unicode-slugify
snowballstemmer==2.1.0
# via sphinx
soupsieve==2.2.1
......@@ -657,12 +654,6 @@ typing-extensions==3.7.4.3
# django-stubs
# djangorestframework-stubs
# mypy
unicode-slugify==0.1.3
# via -r requirements/requirements.txt
unidecode==1.2.0
# via
# -r requirements/requirements.txt
# unicode-slugify
uritemplate==3.0.1
# via
# -r requirements/requirements.txt
......
......@@ -9,7 +9,6 @@ channels_redis<3
circus
#CommonMark
django-allauth
django-autoslug
django-braces
django-crispy-forms
django-dynamic-preferences<1.6 # Some breaking changes there
......@@ -42,12 +41,12 @@ lxml
Pillow
psycopg2-binary
python-opengraph-jaywink
python-slugify
pytz
raven
redis
rq
rq-scheduler
unicode-slugify
uwsgi
whitenoise
whoosh
......
......@@ -97,8 +97,6 @@ dirty-validators==0.5.4
# via federation
django-allauth==0.44.0
# via -r requirements/requirements.in
django-autoslug==1.9.8
# via -r requirements/requirements.in
django-braces==1.14.0
# via -r requirements/requirements.in
django-crispy-forms==1.11.2
......@@ -279,7 +277,9 @@ python-magic==0.4.22
python-opengraph-jaywink==0.2.0
# via -r requirements/requirements.in
python-slugify==5.0.0
# via federation
# via
# -r requirements/requirements.in
# federation
python-xrd==0.1
# via federation
python3-openid==3.2.0
......@@ -343,7 +343,6 @@ six==1.15.0
# pyopenssl
# python-dateutil
# traitlets
# unicode-slugify
soupsieve==2.2.1
# via beautifulsoup4
sqlparse==0.4.1
......@@ -364,10 +363,6 @@ twisted[tls]==21.2.0
# via daphne
txaio==21.2.1
# via autobahn
unicode-slugify==0.1.3
# via -r requirements/requirements.in
unidecode==1.2.0
# via unicode-slugify
uritemplate==3.0.1
# via
# coreapi
......
......@@ -274,7 +274,7 @@ class Profile(TimeStampedModel):
# Then replace rest of /'s with _'s
handle_or_fid = handle_or_fid.replace("/", "_")
# Compile
remote_username_part = slugify(handle_or_fid, only_ascii=True, ok='._=-')[:max_username_part_length]
remote_username_part = slugify(handle_or_fid, regex_pattern='^[a-z\\._=-]$')[:max_username_part_length]
return template.replace("%%USERNAME%%", remote_username_part)
@property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment