diff --git a/forum/views/topic.py b/forum/views/topic.py index a77b6a3..a74e735 100644 --- a/forum/views/topic.py +++ b/forum/views/topic.py @@ -49,6 +49,7 @@ def get_view(request, topic_id, errors=None): topic = Topic.objects.get_topic_by_topic_id(topic_id) except Topic.DoesNotExist: raise Http404 + user = request.user if user.is_authenticated(): counter = { @@ -151,7 +152,7 @@ def post_view(request, topic_id): reputation = reputation + 2 * math.log(user.reputation or 0 + topic_time_diff.days + 10, 10) ForumUser.objects.filter(pk=topic.author.id).update(reputation=reputation) - return redirect('/t/%s/#reply%s' % (topic.id, topic.reply_count + 1)) + return get_view(request, topic_id, errors=form.errors) @login_required