Browse Source

Fixed a few bugs

sh4nks 11 years ago
parent
commit
0c6fcb9afe
3 changed files with 5 additions and 6 deletions
  1. 1 2
      flaskbb/auth/forms.py
  2. 1 1
      flaskbb/templates/forum/forum.html
  3. 3 3
      flaskbb/templates/forum/topic.html

+ 1 - 2
flaskbb/auth/forms.py

@@ -64,8 +64,7 @@ class RegisterForm(Form):
                     email=self.email.data,
                     password=self.password.data,
                     date_joined=datetime.utcnow(),
-                    primary_group=4)
-        user.groups.append(4)
+                    primary_group_id=4)
         return user.save()
 
 

+ 1 - 1
flaskbb/templates/forum/forum.html

@@ -15,7 +15,7 @@
     {{ render_pagination(topics, url_for('forum.view_forum', forum_id=forum.id)) }}
 </div> <!-- end span pagination -->
 
-{% if current_user.is_authenticated() %}
+{% if current_user|post_topic(forum) %}
 <div class="pull-right" style="padding-bottom: 10px">
     <a href="{{ url_for('forum.new_topic', forum_id=forum.id) }}" class="btn btn-primary">New Topic</a>
 </div>

+ 3 - 3
flaskbb/templates/forum/topic.html

@@ -20,7 +20,7 @@
     {% if current_user|post_reply(topic.forum) and not topic.locked %}
     <a href="{{ url_for('forum.new_post', topic_id=topic.id) }}" class="btn btn-primary">Reply</a>
     {% endif %}
-    {% if current_user|delete_topic(topic, topic.forum) %}
+    {% if current_user|delete_topic(topic.first_post.user_id, topic.forum) %}
     <a href="{{ url_for('forum.delete_topic', topic_id=topic.id) }}" class="btn btn-primary">Delete Topic</a>
     {% endif %}
 </div>
@@ -103,10 +103,10 @@
                 </span>
 
                 <span class="pull-right">
-                    {% if current_user|edit_post(post, topic.forum) %}
+                    {% if current_user|edit_post(post.user_id, topic.forum) %}
                     <a href="{{ url_for('forum.edit_post', post_id=post.id) }}">Edit</a> |
                     {% endif %}
-                    {% if current_user|delete_post(post, topic.forum) %}
+                    {% if current_user|delete_post(post.user_id, topic.forum) %}
                     <a href="{{ url_for('forum.delete_post', post_id=post.id) }}">Delete</a> |
                     {% endif %}
                     <a href="#">Quote</a>