From 6894c70b9f80a6ac3202bb088631b6d571a45b10 Mon Sep 17 00:00:00 2001 From: wuaho Date: Mon, 18 Oct 2021 13:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/endpoints/project.py | 1 + 1 file changed, 1 insertion(+) diff --git a/api/api_v1/endpoints/project.py b/api/api_v1/endpoints/project.py index fb95c29..8a284fd 100644 --- a/api/api_v1/endpoints/project.py +++ b/api/api_v1/endpoints/project.py @@ -68,6 +68,7 @@ async def read_project(request: Request, """查看自己拥有的项目""" if request.user.username == 'root': resp = await crud.project.all_game(db) + resp = sorted(resp, key=lambda x: x.get('sort') or 999) else: game_list = casbin_enforcer.get_domains_for_user(request.user.username) resp = await crud.project.get_my_game(db, game_list)