Browse Source

cast page to int in ViewPost

Should resolve issue #404 where redirecting to specific posts in a topic fails due to integer conversion
haliphax 7 years ago
parent
commit
e5b80a4bfe
1 changed files with 1 additions and 1 deletions
  1. 1 1
      flaskbb/forum/views.py

+ 1 - 1
flaskbb/forum/views.py

@@ -117,7 +117,7 @@ class ViewPost(MethodView):
         post = Post.query.filter_by(id=post_id).first_or_404()
         post_in_topic = Post.query.filter(Post.topic_id == post.topic_id,
                                           Post.id <= post_id).order_by(Post.id.asc()).count()
-        page = math.ceil(post_in_topic / float(flaskbb_config['POSTS_PER_PAGE']))
+        page = int(math.ceil(post_in_topic / float(flaskbb_config['POSTS_PER_PAGE'])))
 
         return redirect(
             url_for(