diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 92ef1c890..ae7ce7905 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -73,10 +73,11 @@ jobs: trivy image --no-progress --severity "HIGH,CRITICAL" yyetsbot:latest - name: Comment on CVE PR - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: message: | ``` ${{ steps.trivy.outputs.stdout }} ``` + comment_tag: cve GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/YYeTsFE b/YYeTsFE index d5ecb9b7f..ce8767aaa 160000 --- a/YYeTsFE +++ b/YYeTsFE @@ -1 +1 @@ -Subproject commit d5ecb9b7fe94c8c1bb1a7f9129da5e6bd1c3d991 +Subproject commit ce8767aaa1a945216a866c80f9cef41323c841ce diff --git a/requirements.txt b/requirements.txt index 569d00462..e76585f07 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ requests==2.31.0 -pytelegrambotapi==4.14.0 +pytelegrambotapi==4.14.1 beautifulsoup4==4.12.2 tgbot-ping==1.0.7 redis==5.0.1 apscheduler==3.10.4 -pymongo==4.6.0 +pymongo==4.6.1 tornado==6.4 captcha==0.5.0 passlib==1.7.4 diff --git a/yyetsweb/databases/comment.py b/yyetsweb/databases/comment.py index fcbb99bbe..143d04f75 100644 --- a/yyetsweb/databases/comment.py +++ b/yyetsweb/databases/comment.py @@ -84,6 +84,11 @@ def get_comment(self, resource_id: int, page: int, size: int, **kwargs) -> dict: self.inner_page = kwargs.get("inner_page", 1) self.inner_size = kwargs.get("inner_size", 5) comment_id = kwargs.get("comment_id") + sort = kwargs.get("sort") + if sort == "newest": + sort = pymongo.DESCENDING + else: + sort = pymongo.ASCENDING condition = { "resource_id": resource_id, @@ -109,7 +114,7 @@ def get_comment(self, resource_id: int, page: int, size: int, **kwargs) -> dict: .sort("_id", pymongo.DESCENDING) .limit(size) .skip((page - 1) * size) - ) + ).sort("_id", sort) data = list(data) self.find_children(data) self.convert_objectid(data) diff --git a/yyetsweb/handlers/comment.py b/yyetsweb/handlers/comment.py index 48f6be423..f3f919ba1 100644 --- a/yyetsweb/handlers/comment.py +++ b/yyetsweb/handlers/comment.py @@ -25,6 +25,7 @@ def get_comment(self): inner_size = int(self.get_argument("inner_size", "3")) inner_page = int(self.get_argument("inner_page", "1")) comment_id = self.get_argument("comment_id", None) + sort = self.get_argument("sort", "newest") if not resource_id: self.set_status(HTTPStatus.BAD_REQUEST) @@ -33,6 +34,7 @@ def get_comment(self): resource_id, page, size, + sort=sort, inner_size=inner_size, inner_page=inner_page, comment_id=comment_id,