comparison gpp/forums/views/main.py @ 446:72ef6e809f79

For #218, put back the logic that updates the topic last visit after you make a post.
author Brian Neal <bgneal@gmail.com>
date Mon, 13 Jun 2011 02:19:13 +0000
parents e9f203c5f5bb
children 9d3bd7304050
comparison
equal deleted inserted replaced
445:e9f203c5f5bb 446:72ef6e809f79
346 post = form.save(request.user, request.META.get("REMOTE_ADDR", "")) 346 post = form.save(request.user, request.META.get("REMOTE_ADDR", ""))
347 post.unread = True 347 post.unread = True
348 post.user.user_profile = request.user.get_profile() 348 post.user.user_profile = request.user.get_profile()
349 post.attach_list = post.attachments.all() 349 post.attach_list = post.attachments.all()
350 _bump_post_count(request.user) 350 _bump_post_count(request.user)
351 _update_last_visit(request.user, form.topic, datetime.datetime.now())
351 352
352 return render_to_response('forums/display_post.html', { 353 return render_to_response('forums/display_post.html', {
353 'post': post, 354 'post': post,
354 'can_moderate': _can_moderate(form.topic.forum, request.user), 355 'can_moderate': _can_moderate(form.topic.forum, request.user),
355 'can_reply': True, 356 'can_reply': True,
593 594
594 # Save any attachments 595 # Save any attachments
595 form.attach_proc.save_attachments(post) 596 form.attach_proc.save_attachments(post)
596 597
597 _bump_post_count(request.user) 598 _bump_post_count(request.user)
599 _update_last_visit(request.user, topic, datetime.datetime.now())
598 return HttpResponseRedirect(post.get_absolute_url()) 600 return HttpResponseRedirect(post.get_absolute_url())
599 else: 601 else:
600 quote_id = request.GET.get('quote') 602 quote_id = request.GET.get('quote')
601 if quote_id: 603 if quote_id:
602 quote_post = get_object_or_404(Post.objects.select_related(), 604 quote_post = get_object_or_404(Post.objects.select_related(),