Skip to content

Commit

Permalink
Merge branch 'hotfix/2.17.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayala Shachar committed Aug 6, 2019
2 parents 406fa51 + dcdf6fa commit 3d3a10c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog


## Version 2.17.2

* Fix pagination in subject view
* Fix post_comment API when using runtoken

## Version 2.17.1

* Fix session replica bug
Expand Down
5 changes: 3 additions & 2 deletions flask_app/blueprints/api/comments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .blueprint import API
from flask_security import current_user
from flask import g
from ...models import Session, Test, db, Comment


Expand All @@ -12,8 +13,8 @@ def post_comment(comment: str, session_id: int=None, test_id: int=None):
obj = Session.query.get_or_404(session_id)
else:
obj = Test.query.get_or_404(test_id)

returned = Comment(user_id=current_user.id, comment=comment)
user_id = current_user.get_id() or g.token_user.get_id()
returned = Comment(user_id=user_id, comment=comment)
obj.comments.append(returned)

obj.num_comments = type(obj).num_comments + 1
Expand Down
4 changes: 2 additions & 2 deletions webapp/app/subject/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

{{query-results results=sessions
meta=sessions.meta
page=(mut pagination.page)
page_size=(mut pagination.page_size)
page=(mut page)
page_size=(mut page_size)
show_successful=(mut filters.show_successful)
show_unsuccessful=(mut filters.show_unsuccessful)
show_abandoned=(mut filters.show_abandoned)
Expand Down

0 comments on commit 3d3a10c

Please sign in to comment.