summaryrefslogtreecommitdiff
path: root/news
diff options
context:
space:
mode:
Diffstat (limited to 'news')
-rw-r--r--news/urls.py4
-rw-r--r--news/views.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/news/urls.py b/news/urls.py
index 548d80ea..d938ef58 100644
--- a/news/urls.py
+++ b/news/urls.py
@@ -4,11 +4,11 @@ urlpatterns = patterns('news.views',
(r'^$', 'news_list', {}, 'news-list'),
(r'^add/$', 'add'),
(r'^preview/$', 'preview'),
+ # old news URLs, permanent redirect view so we don't break all links
+ (r'^(?P<object_id>\d+)/$', 'view_redirect'),
(r'^(?P<slug>[-\w]+)/$', 'view'),
(r'^(?P<slug>[-\w]+)/edit/$', 'edit'),
(r'^(?P<slug>[-\w]+)/delete/$', 'delete'),
- # old news URLs, permanent redirect view so we don't break all links
- (r'^(?P<object_id>\d+)/$', 'view_redirect'),
)
# vim: set ts=4 sw=4 et:
diff --git a/news/views.py b/news/views.py
index f3d7312f..990ee154 100644
--- a/news/views.py
+++ b/news/views.py
@@ -56,7 +56,7 @@ def add(request):
newsitem.author = request.user
newsitem.slug = find_unique_slug(newsitem)
newsitem.save()
- return redirect(newsitem.get_absolute_url())
+ return redirect(newsitem)
else:
form = NewsForm()
return direct_to_template(request, 'news/add.html', { 'form': form })