comparison gpp/forums/views/favorites.py @ 383:b2b37cdd020a

Fixing #189; 500 error when deleting forum topic subscription.
author Brian Neal <bgneal@gmail.com>
date Wed, 16 Mar 2011 01:19:45 +0000
parents a46788862737
children 9d3bd7304050
comparison
equal deleted inserted replaced
382:a1b03de20345 383:b2b37cdd020a
45 except ValueError: 45 except ValueError:
46 raise Http404 46 raise Http404
47 for topic in user.favorite_topics.filter(id__in=delete_ids): 47 for topic in user.favorite_topics.filter(id__in=delete_ids):
48 user.favorite_topics.remove(topic) 48 user.favorite_topics.remove(topic)
49 49
50 page_num = request.POST.get('page', 1) 50 return HttpResponseRedirect(reverse("forums-manage_favorites"))
51 else:
52 page_num = request.GET.get('page', 1)
53 51
52 page_num = request.GET.get('page', 1)
54 topics = user.favorite_topics.select_related().order_by('-update_date') 53 topics = user.favorite_topics.select_related().order_by('-update_date')
55 paginator = DiggPaginator(topics, 20, body=5, tail=2, margin=3, padding=2) 54 paginator = DiggPaginator(topics, 20, body=5, tail=2, margin=3, padding=2)
56 try: 55 try:
57 page_num = int(page_num) 56 page_num = int(page_num)
58 except ValueError: 57 except ValueError: