view gpp/urls.py @ 318:c550933ff5b6

Fix a bug where you'd get an error when trying to delete a forum thread (topic does not exist). Apparently when you call topic.delete() the posts would get deleted, but the signal handler for each one would run, and it would try to update the topic's post count or something, but the topic was gone? Reworked the code a bit and explicitly delete the posts first. I also added a sync() call on the parent forum since post counts were not getting adjusted.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Feb 2011 21:46:52 +0000
parents 88b2b9cb8c1f
children 0c18dfb1da1c
line wrap: on
line source
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from django.views.decorators.cache import cache_page

from haystack.views import SearchView, search_view_factory

from news.feeds import LatestNewsFeed
from forums.feeds import ForumsFeed


admin.autodiscover()

urlpatterns = patterns('',
   url(r'^$', 'views.home', name='home'),
   (r'^admin/doc/', include('django.contrib.admindocs.urls')),
   (r'^admin/', include(admin.site.urls)),
   (r'^accounts/', include('accounts.urls')),
   (r'^antispam/', include('antispam.urls')),
   (r'^calendar/', include('gcalendar.urls')),
   (r'^comments/', include('comments.urls')),
   (r'^contact/', include('contact.urls')),
   (r'^core/', include('core.urls')),
   (r'^donations/', include('donations.urls')),
   (r'^downloads/', include('downloads.urls')),
   url(r'^feeds/news/$',
       cache_page(LatestNewsFeed(), 6 * 60 * 60),
       name='feeds-news'),
   url(r'^feeds/forums/$',
       cache_page(ForumsFeed(), 1 * 60 * 60),
       {'forum_slug': None},
       'feeds-forum_combined'),
   url(r'^feeds/forums/(?P<forum_slug>[\w\d-]+)/$',
       cache_page(ForumsFeed(), 1 * 60 * 60),
       name='feeds-forum'),
   (r'^forums/', include('forums.urls')),
   (r'^irc/', include('irc.urls')),
   (r'^links/', include('weblinks.urls')),
   (r'^member_map/', include('membermap.urls')),
   (r'^messages/', include('messages.urls')),
   (r'^news/', include('news.urls')),
   (r'^oembed/', include('oembed.urls')),
   (r'^podcast/', include('podcast.urls')),
   (r'^polls/', include('polls.urls')),
   (r'^potd/', include('potd.urls')),
   (r'^profile/', include('bio.urls')),
   (r'^shout/', include('shoutbox.urls')),
   (r'^smiley/', include('smiley.urls')),
)

# Haystack search views
urlpatterns += patterns('haystack.views',
    url(r'^search/$', search_view_factory(view_class=SearchView, load_all=True),
        name='haystack_search'),
)


if settings.DEBUG:
   urlpatterns += patterns('django.contrib.staticfiles.views',
      (r'^media/(?P<path>.*)$', 'serve', {'document_root': settings.MEDIA_ROOT}),
   )