瀏覽代碼

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 查看文件

else: else:
return None 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 @classmethod
@DB.connection_context() @DB.connection_context()
def save(cls, **kwargs): def save(cls, **kwargs):
if num == 0: if num == 0:
raise LookupError("Tenant not found which is supposed to be there") 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): class UserTenantService(CommonService):
model = UserTenant model = UserTenant

Loading…
取消
儲存