Skip to content

Commit 3d3a10c

Browse files
author
Ayala Shachar
committed
Merge branch 'hotfix/2.17.2'
2 parents 406fa51 + dcdf6fa commit 3d3a10c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

33

4+
## Version 2.17.2
5+
6+
* Fix pagination in subject view
7+
* Fix post_comment API when using runtoken
8+
49
## Version 2.17.1
510

611
* Fix session replica bug

flask_app/blueprints/api/comments.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from .blueprint import API
22
from flask_security import current_user
3+
from flask import g
34
from ...models import Session, Test, db, Comment
45

56

@@ -12,8 +13,8 @@ def post_comment(comment: str, session_id: int=None, test_id: int=None):
1213
obj = Session.query.get_or_404(session_id)
1314
else:
1415
obj = Test.query.get_or_404(test_id)
15-
16-
returned = Comment(user_id=current_user.id, comment=comment)
16+
user_id = current_user.get_id() or g.token_user.get_id()
17+
returned = Comment(user_id=user_id, comment=comment)
1718
obj.comments.append(returned)
1819

1920
obj.num_comments = type(obj).num_comments + 1

webapp/app/subject/template.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
{{query-results results=sessions
1111
meta=sessions.meta
12-
page=(mut pagination.page)
13-
page_size=(mut pagination.page_size)
12+
page=(mut page)
13+
page_size=(mut page_size)
1414
show_successful=(mut filters.show_successful)
1515
show_unsuccessful=(mut filters.show_unsuccessful)
1616
show_abandoned=(mut filters.show_abandoned)

0 commit comments

Comments
 (0)