# HG changeset patch # User neko259 # Date 2017-11-05 09:50:20 # Node ID d990a0f1eeca57460cf071eb9520fc7bca79d498 # Parent 73ab365f1a23ca53163d0457ff68b86a3fd6a1ec Allow using apostrophe in tags diff --git a/boards/abstracts/constants.py b/boards/abstracts/constants.py --- a/boards/abstracts/constants.py +++ b/boards/abstracts/constants.py @@ -1,4 +1,4 @@ import re FILE_DIRECTORY = 'files/' -REGEX_TAGS = re.compile(r'^[\w\s\d]+$', re.UNICODE) +REGEX_TAGS = re.compile(r'^[\w\s\d\']+$', re.UNICODE) diff --git a/boards/urls.py b/boards/urls.py --- a/boards/urls.py +++ b/boards/urls.py @@ -24,8 +24,9 @@ urlpatterns = [ url(r'^all/$', all_threads.AllThreadsView.as_view(), name='index'), # /boards/tag/tag_name/ - url(r'^tag/(?P\w+)/$', tag_threads.TagView.as_view(), + url(r'^tag/(?P[\w\d\']+)/$', tag_threads.TagView.as_view(), name='tag'), + url(r'^tag/(?P[\w\d\']+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), # /boards/thread/ url(r'^thread/(?P\d+)/$', views.thread.NormalThreadView.as_view(), @@ -47,7 +48,6 @@ urlpatterns = [ name='staticpage'), url(r'^random/$', RandomImageView.as_view(), name='random'), - url(r'^tag/(?P\w+)/gallery/$', TagGalleryView.as_view(), name='tag_gallery'), url(r'^search/$', BoardSearchView.as_view(), name='search'), url(r'^$', LandingView.as_view(), name='landing'), url(r'^utils$', UtilsView.as_view(), name='utils'),