Mercurial > public > sg101
comparison gpp/forums/views.py @ 122:b28d30848c57
Forums: monkey-patch the user profile onto the post object when doing a quick ajax reply.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Tue, 27 Oct 2009 02:56:16 +0000 |
parents | f8f4514b806a |
children | 3ae999b0c53b |
comparison
equal
deleted
inserted
replaced
121:98d658afd4bf | 122:b28d30848c57 |
---|---|
211 if not _can_post_in_topic(form.topic, request.user): | 211 if not _can_post_in_topic(form.topic, request.user): |
212 return HttpResponseForbidden("You don't have permission to post in this topic.") | 212 return HttpResponseForbidden("You don't have permission to post in this topic.") |
213 | 213 |
214 post = form.save(request.user, request.META.get("REMOTE_ADDR", "")) | 214 post = form.save(request.user, request.META.get("REMOTE_ADDR", "")) |
215 post.unread = True | 215 post.unread = True |
216 post.user_profile = request.user.get_profile() | |
216 _bump_post_count(request.user) | 217 _bump_post_count(request.user) |
217 _update_last_visit(request.user, form.topic) | 218 _update_last_visit(request.user, form.topic) |
218 return render_to_response('forums/display_post.html', { | 219 return render_to_response('forums/display_post.html', { |
219 'post': post, | 220 'post': post, |
220 'can_moderate': _can_moderate(form.topic.forum, request.user), | 221 'can_moderate': _can_moderate(form.topic.forum, request.user), |