Commits

Stanislav Panasik committed 699112e

Fixed bug in Topic.last_post. In topic.html added check for superuser rights.

Comments (0)

Files changed (2)

         #return Post.objects.all()[0]
         posts = self.posts.all().order_by('-created').select_related()
         if len(posts):
-            return [0]
+            return posts[0]
         return None
 
     def get_absolute_url(self):

pybb/templates/pybb/topic.html

  {% if not user.pybb_profile.is_banned %}
   {% if not topic.closed %}
    {% has_row_perm user topic "deny-add-post" as deny_add_post %}
-    {% if not deny_add_post %}
+    {% if not deny_add_post  or user.is_superuser %}
      {% include "pybb/add_post_form.html" %}
     {% endif %}
   {% endif %}