Commit 17cba28932280bac88da73510bdf3cb279d85fc3

Authored by zhenchaozhu
1 parent 5988f9bea4
Exists in master and in 1 other branch de

修改发表评论的bug

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
forum/views/topic.py
... ... @@ -49,6 +49,7 @@ def get_view(request, topic_id, errors=None):
49 49 topic = Topic.objects.get_topic_by_topic_id(topic_id)
50 50 except Topic.DoesNotExist:
51 51 raise Http404
  52 +
52 53 user = request.user
53 54 if user.is_authenticated():
54 55 counter = {
... ... @@ -151,7 +152,7 @@ def post_view(request, topic_id):
151 152 reputation = reputation + 2 * math.log(user.reputation or 0 + topic_time_diff.days + 10, 10)
152 153 ForumUser.objects.filter(pk=topic.author.id).update(reputation=reputation)
153 154  
154   - return redirect('/t/%s/#reply%s' % (topic.id, topic.reply_count + 1))
  155 + return get_view(request, topic_id, errors=form.errors)
155 156  
156 157  
157 158 @login_required
... ...