Browse Source

Added the abillity to track topics via new posts

sh4nks 10 years ago
parent
commit
2006095157
1 changed files with 7 additions and 1 deletions
  1. 7 1
      flaskbb/forum/forms.py

+ 7 - 1
flaskbb/forum/forms.py

@@ -29,8 +29,14 @@ class ReplyForm(Form):
     content = TextAreaField("Content", validators=[
         Required(message="You cannot post a reply without content.")])
 
+    track_topic = BooleanField("Track this topic", default=False, validators=[
+        Optional()])
+
     def save(self, user, topic):
-        post = Post(**self.data)
+        post = Post(content=self.content.data)
+
+        if self.track_topic.data:
+            user.track_topic(topic)
         return post.save(user=user, topic=topic)