Merge branch 'main' of https://gitee.com/wg123/video-gen
This commit is contained in:
@@ -188,7 +188,7 @@ async def get_join_info(
|
||||
"""验证邀请码并返回团队信息(用于加入页面展示)。"""
|
||||
invitation = await team_invitation_service.get_invitation_by_code(db, code)
|
||||
if not invitation:
|
||||
return JoinTeamInfoOut(team_name="", team_id="", valid=False)
|
||||
return JoinTeamInfoOut(team_name="", team_id="", valid=False, already_in_team=False, has_pending_request=False)
|
||||
|
||||
team = await db.execute(
|
||||
select(Team.name).where(Team.id == invitation.team_id, Team.deleted_at.is_(None)).limit(1)
|
||||
@@ -227,7 +227,7 @@ async def get_join_info_public(
|
||||
"""公开接口:验证邀请码并返回团队信息(无需登录)。"""
|
||||
invitation = await team_invitation_service.get_invitation_by_code(db, code)
|
||||
if not invitation:
|
||||
return {"team_name": "", "team_id": "", "valid": False}
|
||||
return {"team_name": "", "team_id": "", "valid": False, "already_in_team": False, "has_pending_request": False}
|
||||
|
||||
team = await db.execute(
|
||||
select(Team.name).where(Team.id == invitation.team_id, Team.deleted_at.is_(None)).limit(1)
|
||||
@@ -238,6 +238,8 @@ async def get_join_info_public(
|
||||
"team_name": team_name,
|
||||
"team_id": invitation.team_id,
|
||||
"valid": True,
|
||||
"already_in_team": False,
|
||||
"has_pending_request": False,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ async def create_join_request(
|
||||
|
||||
# 验证用户存在
|
||||
user_result = await db.execute(
|
||||
select(User).where(User.id == user_id, User.deleted_at.is_(None)).limit(1)
|
||||
select(User).where(User.id == user_id, User.is_active == True).limit(1)
|
||||
)
|
||||
user = user_result.scalar_one_or_none()
|
||||
if not user:
|
||||
|
||||
Reference in New Issue
Block a user