From b5e92fe65e559b93d6e942e0bb557d9dae977aad Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 2 Dec 2020 15:21:15 -0800 Subject: [PATCH 1/2] Allow usernames with dots --- bookwyrm/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 3b3c1ab5..092bec3b 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -6,7 +6,7 @@ from django.urls import path, re_path from bookwyrm import incoming, outgoing, views, settings, wellknown from bookwyrm import view_actions as actions -username_regex = r'(?P[\w\-_]+@[\w\-\_\.]+)' +username_regex = r'(?P[\w\-_\.]+@[\w\-\_\.]+)' localname_regex = r'(?P[\w\-_]+)' user_path = r'^user/%s' % username_regex local_user_path = r'^user/%s' % localname_regex From 2cf73188f2d42360a707b0e65853033d533415d8 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 2 Dec 2020 15:24:43 -0800 Subject: [PATCH 2/2] fixes localname regex --- bookwyrm/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index 092bec3b..a9792038 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -7,7 +7,7 @@ from bookwyrm import incoming, outgoing, views, settings, wellknown from bookwyrm import view_actions as actions username_regex = r'(?P[\w\-_\.]+@[\w\-\_\.]+)' -localname_regex = r'(?P[\w\-_]+)' +localname_regex = r'(?P[\w\-_\.]+)' user_path = r'^user/%s' % username_regex local_user_path = r'^user/%s' % localname_regex @@ -61,8 +61,8 @@ urlpatterns = [ # should return a ui view or activitypub json blob as requested # users re_path(r'%s/?$' % user_path, views.user_page), - re_path(r'%s/?$' % local_user_path, views.user_page), re_path(r'%s\.json$' % local_user_path, views.user_page), + re_path(r'%s/?$' % local_user_path, views.user_page), re_path(r'%s/shelves/?$' % local_user_path, views.user_shelves_page), re_path(r'%s/followers(.json)?/?$' % local_user_path, views.followers_page), re_path(r'%s/following(.json)?/?$' % local_user_path, views.following_page),