Skip to content

Commit

Permalink
fix slug to accept _
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhelmig committed Sep 13, 2012
1 parent 1b0e32b commit 7e89a5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion knowledge/templates/django_knowledge/question_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

<ol class="question-list">
{% for question in questions %}
<li><a href="{{ question.get_absolute_url }}">{{ question.title }}</a>&nbsp; {% if not question.get_responses %}<span class="dk-label dk-label-important">{% trans "no responses" %}</span>{% else %}<span class="dk-label">{{ question.get_responses|length }} responses</span>{% endif %}&nbsp; {% if question.accepted %}<span class="dk-label dk-label-warning">{% trans "accepted" %}</span>&nbsp;{% endif %} {% if question.user.is_staff %}<span class="dk-label dk-label-success">{% trans "staff" %}</span>&nbsp;{% endif %} <small class="quiet">by {{ question.get_name }}</small></li>
<li><a href="{{ question.get_absolute_url }}">{{ question.title }}</a>&nbsp; {% if not question.get_responses %}<span class="dk-label dk-label-important">{% trans "no responses" %}</span>{% else %}<span class="dk-label">{{ question.get_responses|length }}&nbsp;responses</span>{% endif %}&nbsp; {% if question.accepted %}<span class="dk-label dk-label-warning">{% trans "accepted" %}</span>&nbsp;{% endif %} {% if question.user.is_staff %}<span class="dk-label dk-label-success">{% trans "staff" %}</span>&nbsp;{% endif %} <small class="quiet">by {{ question.get_name }}</small></li>
{% endfor %}
</ol>
4 changes: 2 additions & 2 deletions knowledge/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

url(r'^questions/$', 'knowledge_list', name='knowledge_list'),

url(r'^questions/(?P<category_slug>[a-z-]+)/$', 'knowledge_list',
url(r'^questions/(?P<category_slug>[a-z0-9-_]+)/$', 'knowledge_list',
name='knowledge_list_category'),

url(r'^questions/(?P<question_id>\d+)/$',
'knowledge_thread', name='knowledge_thread_no_slug'),

url(r'^questions/(?P<question_id>\d+)/(?P<slug>[a-z0-9-]+)/$',
url(r'^questions/(?P<question_id>\d+)/(?P<slug>[a-z0-9-_]+)/$',
'knowledge_thread', name='knowledge_thread'),

url(r'^moderate/(?P<model>[a-z]+)/'
Expand Down

0 comments on commit 7e89a5c

Please sign in to comment.