浏览代码

Refactor. (#4612)

### What problem does this PR solve?

### Type of change

- [x] Refactoring
tags/v0.16.0
Kevin Hu 9 个月前
父节点
当前提交
e14d6ae441
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6
    6
      api/db/services/user_service.py

+ 6
- 6
api/db/services/user_service.py 查看文件

@@ -50,12 +50,6 @@ class UserService(CommonService):
else:
return None

@classmethod
@DB.connection_context()
def user_gateway(cls, tenant_id):
hashobj = hashlib.sha256(tenant_id.encode("utf-8"))
return int(hashobj.hexdigest(), 16)%len(MINIO)

@classmethod
@DB.connection_context()
def save(cls, **kwargs):
@@ -134,6 +128,12 @@ class TenantService(CommonService):
if num == 0:
raise LookupError("Tenant not found which is supposed to be there")

@classmethod
@DB.connection_context()
def user_gateway(cls, tenant_id):
hashobj = hashlib.sha256(tenant_id.encode("utf-8"))
return int(hashobj.hexdigest(), 16)%len(MINIO)


class UserTenantService(CommonService):
model = UserTenant

正在加载...
取消
保存