Correct show user, who edited post

This commit is contained in:
slav0nic 2010-02-17 13:15:27 +02:00
parent a7a863ad39
commit c3c6ed688d
2 changed files with 5 additions and 3 deletions

View file

@ -13,7 +13,7 @@
<ul>
<li>
<a href="{% url djangobb:index %}">{% trans "Root" %} </a></li><li>&raquo; {% link topic.forum %} </li><li>&raquo; {{ topic.name }}
<a href="{% url djangobb:forum_feed "topic" %}{{ topic.id }}/"><img src="{{ MEDIA_URL }}/forum/img/feed-icon-small.png" alt="[RSS Feed]" title="[RSS Feed]" class="breadcrumb_rss" /></a>
<a href="{% url djangobb:forum_feed "topic" %}{{ topic.id }}/"><img src="{{ MEDIA_URL }}forum/img/feed-icon-small.png" alt="[RSS Feed]" title="[RSS Feed]" class="breadcrumb_rss" /></a>
</li>
</ul>
<div class="clearer"></div>
@ -86,7 +86,7 @@
{% endif %}
{% endif %}
{% if post.updated %}
<p class="postedit"><em>{% trans "Edited" %} {{ post.user }} ({% forum_time post.updated %})</em></p>
<p class="postedit"><em>{% trans "Edited" %} {{ post.updated_by }} ({% forum_time post.updated %})</em></p>
{% endif %}
{% if post.attachments.all %}
{% for attach in post.attachments.all %}

View file

@ -549,7 +549,9 @@ def edit_post(request, post_id):
return HttpResponseRedirect(post.get_absolute_url())
form = build_form(EditPostForm, request, topic=topic, instance=post)
if form.is_valid():
post = form.save()
post = form.save(commit=False)
post.updated_by = request.user
post.save()
return HttpResponseRedirect(post.get_absolute_url())
return {'form': form,