We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 098d26e + d5b2909 commit 8647c3cCopy full SHA for 8647c3c
getcloser/backend/app/services/challenge_service.py
@@ -9,6 +9,16 @@
9
10
11
def assign_challenges_logic(my_id: str, members: list, db: Session) -> list:
12
+ # 현재 사용자 retry_count 조회
13
+ status = db.query(UserChallengeStatus).filter(UserChallengeStatus.user_id == my_id).first()
14
+
15
+ if not status:
16
+ raise HTTPException(status_code=404, detail="User status not found.")
17
18
+ # retry_count 검사
19
+ if status.retry_count >= 2:
20
+ return {"message": "retry_count가 2 이상입니다. 팀을 다시 구성해주세요."}
21
22
team_questions = db.query(ChallengeQuestion).filter(ChallengeQuestion.user_id.in_(members)).all()
23
if len(team_questions) < len(members):
24
raise ValueError("팀원 문제가 충분하지 않습니다.")
0 commit comments