From 6c605483fd57353b3b20bc8d7f8c5c05c12b559f Mon Sep 17 00:00:00 2001 From: wuaho Date: Tue, 30 Nov 2021 15:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91owner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/api_v1/authz/authz.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/api_v1/authz/authz.py b/api/api_v1/authz/authz.py index af8b8d4..e10abd4 100644 --- a/api/api_v1/authz/authz.py +++ b/api/api_v1/authz/authz.py @@ -300,6 +300,14 @@ async def account_owner_list(request: Request, "comparator": "in", "ftv": data_in.owners } + if not data_in.owners[0]: + res = await crud.user.update_one(db, {'name': data_in.account_name, + f'data_where.{game}': {'$exists': True} + }, + {'$pull': {f'data_where.{game}': {'columnName': 'owner_name'}}} + ) + return schemas.Msg(code=0, msg='ok', data=res.raw_result) + is_exists = await crud.user.find_one(db, {'name': data_in.account_name, f'data_where.{game}': {'$exists': True}, })