浏览代码

Fix non-null violation when inviting people to team (#3015)

### What problem does this PR solve?

Not sure why MySQL is inserting empty string in this case, but when I
use postgres I got `null value in column "invited_by" of relation
"user_tenant" violates not-null constraint`

### Type of change

- [X] Bug Fix (non-breaking change which fixes an issue)
tags/v0.13.0
Brody Wang 1年前
父节点
当前提交
391b950be6
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      api/apps/tenant_app.py

+ 2
- 1
api/apps/tenant_app.py 查看文件

id=get_uuid(), id=get_uuid(),
user_id=user_id, user_id=user_id,
tenant_id=tenant_id, tenant_id=tenant_id,
invited_by=current_user.id,
role=UserTenantRole.INVITE, role=UserTenantRole.INVITE,
status=StatusEnum.VALID.value) status=StatusEnum.VALID.value)


UserTenantService.filter_update([UserTenant.tenant_id == tenant_id, UserTenant.user_id == current_user.id], {"role": UserTenantRole.NORMAL}) UserTenantService.filter_update([UserTenant.tenant_id == tenant_id, UserTenant.user_id == current_user.id], {"role": UserTenantRole.NORMAL})
return get_json_result(data=True) return get_json_result(data=True)
except Exception as e: except Exception as e:
return server_error_response(e)
return server_error_response(e)

正在加载...
取消
保存