|
@@ -25,8 +25,8 @@ class ValidateThreadNameMixin(object):
|
|
|
|
|
|
|
|
|
class RedirectToPostMixin(object):
|
|
|
- def _redirect_to_post(self, link, post):
|
|
|
+ def redirect_to_post(self, post):
|
|
|
pagination = make_pagination(0, self.request.acl.threads.filter_posts(self.request, self.thread, self.thread.post_set).filter(id__lte=post.pk).count(), self.request.settings.posts_per_page)
|
|
|
if pagination['total'] > 1:
|
|
|
- return redirect(reverse(link, kwargs={'thread': self.thread.pk, 'slug': self.thread.slug, 'page': pagination['total']}) + ('#post-%s' % post.pk))
|
|
|
- return redirect(reverse(link, kwargs={'thread': self.thread.pk, 'slug': self.thread.slug}) + ('#post-%s' % post.pk))
|
|
|
+ return redirect(reverse(self.thread_url, kwargs={'thread': self.thread.pk, 'slug': self.thread.slug, 'page': pagination['total']}) + ('#post-%s' % post.pk))
|
|
|
+ return redirect(reverse(self.thread_url, kwargs={'thread': self.thread.pk, 'slug': self.thread.slug}) + ('#post-%s' % post.pk))
|