regex \d -> [0-9]

This commit is contained in:
nitely 2018-02-23 17:22:31 -03:00
parent f06f2118c5
commit 74b11f14aa
20 changed files with 64 additions and 64 deletions

View File

@ -10,5 +10,5 @@ from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^create/$', views.create, name='create'),
url(r'^update/(?P<category_id>\d+)/$', views.update, name='update'),
url(r'^update/(?P<category_id>[0-9]+)/$', views.update, name='update'),
]

View File

@ -10,6 +10,6 @@ from . import views
urlpatterns = [
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<pk>\d+)/$', views.detail, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<pk>\d+)/(?P<slug>[\w-]+)/$', views.detail, name='detail'),
]
url(r'^(?P<pk>[0-9]+)/$', views.detail, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<pk>[0-9]+)/(?P<slug>[\w-]+)/$', views.detail, name='detail'),
]

View File

@ -8,6 +8,6 @@ from . import views
urlpatterns = [
url(r'^(?P<topic_id>\d+)/create/$', views.create, name='create'),
url(r'^(?P<topic_id>\d+)/find/$', views.find, name='find'),
url(r'^(?P<topic_id>[0-9]+)/create/$', views.create, name='create'),
url(r'^(?P<topic_id>[0-9]+)/find/$', views.find, name='find'),
]

View File

@ -11,5 +11,5 @@ urlpatterns = [
url(r'^$', views.opened, name='index'),
url(r'^opened/$', views.opened, name='opened'),
url(r'^closed/$', views.closed, name='closed'),
url(r'^(?P<pk>\d+)/$', views.detail, name='detail'),
url(r'^(?P<pk>[0-9]+)/$', views.detail, name='detail'),
]

View File

@ -8,5 +8,5 @@ from . import views
urlpatterns = [
url(r'^(?P<comment_id>\d+)/create/$', views.create, name='create'),
url(r'^(?P<comment_id>[0-9]+)/create/$', views.create, name='create'),
]

View File

@ -27,10 +27,10 @@ except ImportError as err:
# There used to be a logger.exception here but
# the traceback made things confusing when an unhandled was raised
if settings.ST_UPLOAD_FILE_ENABLED:
logger.warning(
'Can\'t load python-magic. '
'Is libmagic installed?')
logger.error(err)
logger.info(
'File upload requires running: '
'`pip install django-spirit[files]`')
raise err
magic = None

View File

@ -8,5 +8,5 @@ from . import views
urlpatterns = [
url(r'^(?P<comment_id>\d+)/$', views.detail, name='detail'),
url(r'^(?P<comment_id>[0-9]+)/$', views.detail, name='detail'),
]

View File

@ -8,6 +8,6 @@ from . import views
urlpatterns = [
url(r'^(?P<comment_id>\d+)/create/$', views.create, name='create'),
url(r'^(?P<pk>\d+)/delete/$', views.delete, name='delete'),
url(r'^(?P<comment_id>[0-9]+)/create/$', views.create, name='create'),
url(r'^(?P<pk>[0-9]+)/delete/$', views.delete, name='delete'),
]

View File

@ -8,8 +8,8 @@ from . import views
urlpatterns = [
url(r'^close/(?P<pk>\d+)/$', views.close_or_open, name='close'),
url(r'^open/(?P<pk>\d+)/$', views.close_or_open, kwargs={'close': False}, name='open'),
url(r'^vote/(?P<pk>\d+)/$', views.vote, name='vote'),
url(r'^voters/(?P<pk>\d+)/$', views.voters, name='voters'),
url(r'^close/(?P<pk>[0-9]+)/$', views.close_or_open, name='close'),
url(r'^open/(?P<pk>[0-9]+)/$', views.close_or_open, kwargs={'close': False}, name='open'),
url(r'^vote/(?P<pk>[0-9]+)/$', views.vote, name='vote'),
url(r'^voters/(?P<pk>[0-9]+)/$', views.voters, name='voters'),
]

View File

@ -14,15 +14,15 @@ from . import views
urlpatterns = [
url(r'^(?P<topic_id>\d+)/publish/$', views.publish, name='publish'),
url(r'^(?P<topic_id>\d+)/publish/(?P<pk>\d+)/quote/$', views.publish, name='publish'),
url(r'^(?P<topic_id>[0-9]+)/publish/$', views.publish, name='publish'),
url(r'^(?P<topic_id>[0-9]+)/publish/(?P<pk>[0-9]+)/quote/$', views.publish, name='publish'),
url(r'^(?P<pk>\d+)/update/$', views.update, name='update'),
url(r'^(?P<pk>\d+)/find/$', views.find, name='find'),
url(r'^(?P<topic_id>\d+)/move/$', views.move, name='move'),
url(r'^(?P<pk>[0-9]+)/update/$', views.update, name='update'),
url(r'^(?P<pk>[0-9]+)/find/$', views.find, name='find'),
url(r'^(?P<topic_id>[0-9]+)/move/$', views.move, name='move'),
url(r'^(?P<pk>\d+)/delete/$', views.delete, name='delete'),
url(r'^(?P<pk>\d+)/undelete/$', views.delete, kwargs={'remove': False, }, name='undelete'),
url(r'^(?P<pk>[0-9]+)/delete/$', views.delete, name='delete'),
url(r'^(?P<pk>[0-9]+)/undelete/$', views.delete, kwargs={'remove': False, }, name='undelete'),
url(r'^bookmark/', include(spirit.comment.bookmark.urls, namespace='bookmark')),
url(r'^flag/', include(spirit.comment.flag.urls, namespace='flag')),

View File

@ -59,9 +59,9 @@ class BlockGrammar(mistune.BlockGrammar):
r'vimeo\.com/'
r'(?:channels/'
r'|groups/[^/]+/videos/'
r'|album/(?:\d+)/video/'
r'|album/(?:[0-9]+)/video/'
r'|video/)?'
r'(?P<vimeo_id>\d+)'
r'(?P<vimeo_id>[0-9]+)'
r'(?:\?[^\s]+)?'
r'(?:\n+|$)'
r')|'
@ -105,14 +105,14 @@ class BlockGrammar(mistune.BlockGrammar):
poll = re.compile(
r'^(?:\[poll'
r'((?:\s+name=(?P<name>[\w\-_]+))'
r'(?:\s+min=(?P<min>\d+))?'
r'(?:\s+max=(?P<max>\d+))?'
r'(?:\s+close=(?P<close>\d+)d)?'
r'(?:\s+min=(?P<min>[0-9]+))?'
r'(?:\s+max=(?P<max>[0-9]+))?'
r'(?:\s+close=(?P<close>[0-9]+)d)?'
r'(?:\s+mode=(?P<mode>(default|secret)))?'
r'|(?P<invalid_params>[^\]]*))'
r'\])\n'
r'((?:#\s*(?P<title>[^\n]+\n))?'
r'(?P<choices>(?:\d+\.\s*[^\n]+\n){2,})'
r'(?P<choices>(?:[0-9]+\.\s*[^\n]+\n){2,})'
r'|(?P<invalid_body>(?:[^\n]+\n)*))'
r'(?:\[/poll\])'
)

View File

@ -11,7 +11,7 @@ from ....conf import settings
_PATTERN_POLL = re.compile(
r'^(?:\[poll[^\]]*\])\n+'
r'(?:\d+[^\n]*\n+)+'
r'(?:[0-9]+[^\n]*\n+)+'
r'(?:\[/poll\])',
flags=re.MULTILINE
)

View File

@ -8,6 +8,6 @@ from . import views
urlpatterns = [
url(r'^(?P<topic_id>\d+)/create/$', views.create, name='create'),
url(r'^(?P<pk>\d+)/delete/$', views.delete, name='delete'),
url(r'^(?P<topic_id>[0-9]+)/create/$', views.create, name='create'),
url(r'^(?P<pk>[0-9]+)/delete/$', views.delete, name='delete'),
]

View File

@ -8,15 +8,15 @@ from . import views
urlpatterns = [
url(r'^delete/(?P<pk>\d+)/$', views.delete, name='delete'),
url(r'^undelete/(?P<pk>\d+)/$', views.undelete, name='undelete'),
url(r'^delete/(?P<pk>[0-9]+)/$', views.delete, name='delete'),
url(r'^undelete/(?P<pk>[0-9]+)/$', views.undelete, name='undelete'),
url(r'^lock/(?P<pk>\d+)/$', views.lock, name='lock'),
url(r'^unlock/(?P<pk>\d+)/$', views.unlock, name='unlock'),
url(r'^lock/(?P<pk>[0-9]+)/$', views.lock, name='lock'),
url(r'^unlock/(?P<pk>[0-9]+)/$', views.unlock, name='unlock'),
url(r'^pin/(?P<pk>\d+)/$', views.pin, name='pin'),
url(r'^unpin/(?P<pk>\d+)/$', views.unpin, name='unpin'),
url(r'^pin/(?P<pk>[0-9]+)/$', views.pin, name='pin'),
url(r'^unpin/(?P<pk>[0-9]+)/$', views.unpin, name='unpin'),
url(r'^global-pin/(?P<pk>\d+)/$', views.global_pin, name='global-pin'),
url(r'^global-unpin/(?P<pk>\d+)/$', views.global_unpin, name='global-unpin'),
url(r'^global-pin/(?P<pk>[0-9]+)/$', views.global_pin, name='global-pin'),
url(r'^global-unpin/(?P<pk>[0-9]+)/$', views.global_unpin, name='global-unpin'),
]

View File

@ -11,6 +11,6 @@ urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^unread/$', views.index_unread, name='index-unread'),
url(r'^ajax/$', views.index_ajax, name='index-ajax'),
url(r'^(?P<topic_id>\d+)/create/$', views.create, name='create'),
url(r'^(?P<pk>\d+)/update/$', views.update, name='update'),
url(r'^(?P<topic_id>[0-9]+)/create/$', views.create, name='create'),
url(r'^(?P<pk>[0-9]+)/update/$', views.update, name='update'),
]

View File

@ -12,12 +12,12 @@ urlpatterns = [
url(r'^author/$', views.index_author, name='index-author'),
url(r'^publish/$', views.publish, name='publish'),
url(r'^publish/(?P<user_id>\d+)/$', views.publish, name='publish'),
url(r'^publish/(?P<user_id>[0-9]+)/$', views.publish, name='publish'),
url(r'^(?P<topic_id>\d+)/$', views.detail, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<topic_id>\d+)/(?P<slug>[\w-]+)/$', views.detail, name='detail'),
url(r'^(?P<topic_id>[0-9]+)/$', views.detail, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<topic_id>[0-9]+)/(?P<slug>[\w-]+)/$', views.detail, name='detail'),
url(r'^invite/(?P<topic_id>\d+)/$', views.create_access, name='access-create'),
url(r'^remove/(?P<pk>\d+)/$', views.delete_access, name='access-remove'),
url(r'^join/(?P<topic_id>\d+)/$', views.join_in, name='join'),
url(r'^invite/(?P<topic_id>[0-9]+)/$', views.create_access, name='access-create'),
url(r'^remove/(?P<pk>[0-9]+)/$', views.delete_access, name='access-remove'),
url(r'^join/(?P<topic_id>[0-9]+)/$', views.join_in, name='join'),
]

View File

@ -14,12 +14,12 @@ from . import views
urlpatterns = [
url(r'^publish/$', views.publish, name='publish'),
url(r'^publish/(?P<category_id>\d+)/$', views.publish, name='publish'),
url(r'^publish/(?P<category_id>[0-9]+)/$', views.publish, name='publish'),
url(r'^update/(?P<pk>\d+)/$', views.update, name='update'),
url(r'^update/(?P<pk>[0-9]+)/$', views.update, name='update'),
url(r'^(?P<pk>\d+)/$', views.detail, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<pk>\d+)/(?P<slug>[\w-]+)/$', views.detail, name='detail'),
url(r'^(?P<pk>[0-9]+)/$', views.detail, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<pk>[0-9]+)/(?P<slug>[\w-]+)/$', views.detail, name='detail'),
url(r'^active/$', views.index_active, name='index-active'),

View File

@ -12,5 +12,5 @@ urlpatterns = [
url(r'^admins/$', views.index_admins, name='index-admins'),
url(r'^mods/$', views.index_mods, name='index-mods'),
url(r'^unactive/$', views.index_unactive, name='index-unactive'),
url(r'^edit/(?P<user_id>\d+)/$', views.edit, name='edit'),
url(r'^edit/(?P<user_id>[0-9]+)/$', views.edit, name='edit'),
]

View File

@ -16,7 +16,7 @@ urlpatterns = [
url(r'^register/$', views.register, name='register'),
url(r'^resend-activation/$', views.resend_activation_email, name='resend-activation'),
url(r'^activation/(?P<pk>\d+)/(?P<token>[0-9A-Za-z_\-\.]+)/$', views.registration_activation,
url(r'^activation/(?P<pk>[0-9]+)/(?P<token>[0-9A-Za-z_\-\.]+)/$', views.registration_activation,
name='registration-activation'),
url(r'^password-reset/$', views.custom_password_reset,
{

View File

@ -14,16 +14,16 @@ urlpatterns = [
url(r'^email-change/$', views.email_change, name='email-change'),
url(r'^email-change/(?P<token>[0-9A-Za-z_\-\.]+)/$', views.email_change_confirm, name='email-change-confirm'),
url(r'^(?P<pk>\d+)/$', views.comments, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<pk>\d+)/(?P<slug>[\w-]+)/$', views.comments, name='detail'),
url(r'^(?P<pk>[0-9]+)/$', views.comments, kwargs={'slug': "", }, name='detail'),
url(r'^(?P<pk>[0-9]+)/(?P<slug>[\w-]+)/$', views.comments, name='detail'),
url(r'^topics/(?P<pk>\d+)/$', views.topics, kwargs={'slug': "", }, name='topics'),
url(r'^topics/(?P<pk>\d+)/(?P<slug>[\w-]+)/$', views.topics, name='topics'),
url(r'^topics/(?P<pk>[0-9]+)/$', views.topics, kwargs={'slug': "", }, name='topics'),
url(r'^topics/(?P<pk>[0-9]+)/(?P<slug>[\w-]+)/$', views.topics, name='topics'),
url(r'^likes/(?P<pk>\d+)/$', views.likes, kwargs={'slug': "", }, name='likes'),
url(r'^likes/(?P<pk>\d+)/(?P<slug>[\w-]+)/$', views.likes, name='likes'),
url(r'^likes/(?P<pk>[0-9]+)/$', views.likes, kwargs={'slug': "", }, name='likes'),
url(r'^likes/(?P<pk>[0-9]+)/(?P<slug>[\w-]+)/$', views.likes, name='likes'),
url(r'^menu/$', views.menu, name='menu'),
url(r'^', include(auth_urls, namespace='auth')),
]
]