Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Fixed warning with unnecessary dollar at the end of routers (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
vthaian authored Feb 26, 2019
1 parent 994a00a commit d240a61
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog

* Updated translations
* Fixed error when page with attached menu without apphook was not working
* Removed the dollar from the routes


2.2.1 (2019-02-12)
Expand Down
34 changes: 16 additions & 18 deletions aldryn_newsblog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@


urlpatterns = [
url(r'^$',
ArticleList.as_view(), name='article-list'),
url(r'^feed/$', LatestArticlesFeed(), name='article-list-feed'),
url(r'^', ArticleList.as_view(), name='article-list'),
url(r'^feed/', LatestArticlesFeed(), name='article-list-feed'),

url(r'^search/$',
url(r'^search/',
ArticleSearchResultsList.as_view(), name='article-search'),

url(r'^(?P<year>\d{4})/$',
url(r'^(?P<year>\d{4})/',
YearArticleList.as_view(), name='article-list-by-year'),
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/$',
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/',
MonthArticleList.as_view(), name='article-list-by-month'),
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$',
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/',
DayArticleList.as_view(), name='article-list-by-day'),

# Various permalink styles that we support
Expand All @@ -29,29 +28,28 @@
# NOTE: We cannot support /year/month/pk, /year/pk, or /pk, since these
# patterns collide with the list/archive views, which we'd prefer to
# continue to support.
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<pk>\d+)/$',
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<pk>\d+)/',
ArticleDetail.as_view(), name='article-detail'),
# These support permalinks with <article_slug>
url(r'^(?P<slug>\w[-\w]*)/$',
url(r'^(?P<slug>\w[-\w]*)/',
ArticleDetail.as_view(), name='article-detail'),
url(r'^(?P<year>\d{4})/(?P<slug>\w[-\w]*)/$',
url(r'^(?P<year>\d{4})/(?P<slug>\w[-\w]*)/',
ArticleDetail.as_view(), name='article-detail'),
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<slug>\w[-\w]*)/$',
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<slug>\w[-\w]*)/',
ArticleDetail.as_view(), name='article-detail'),
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>\w[-\w]*)/$', # flake8: NOQA
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>\w[-\w]*)/', # flake8: noqa
ArticleDetail.as_view(), name='article-detail'),

url(r'^author/(?P<author>\w[-\w]*)/$',
url(r'^author/(?P<author>\w[-\w]*)/',
AuthorArticleList.as_view(), name='article-list-by-author'),

url(r'^category/(?P<category>\w[-\w]*)/$',
url(r'^category/(?P<category>\w[-\w]*)/',
CategoryArticleList.as_view(), name='article-list-by-category'),
url(r'^category/(?P<category>\w[-\w]*)/feed/$',
url(r'^category/(?P<category>\w[-\w]*)/feed/',
CategoryFeed(), name='article-list-by-category-feed'),

url(r'^tag/(?P<tag>\w[-\w]*)/$',
url(r'^tag/(?P<tag>\w[-\w]*)/',
TagArticleList.as_view(), name='article-list-by-tag'),
url(r'^tag/(?P<tag>\w[-\w]*)/feed/$',
url(r'^tag/(?P<tag>\w[-\w]*)/feed/',
TagFeed(), name='article-list-by-tag-feed'),

]

2 comments on commit d240a61

@useHTML5
Copy link

@useHTML5 useHTML5 commented on d240a61 Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without dollar django (django==1.11.20) always open first article list url only.

@bplociennik
Copy link

@bplociennik bplociennik commented on d240a61 Mar 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @useHTML5. I discovered it after deeper tests and fix is available here #524

Please sign in to comment.