Task: fix when no additional_requests_to_be_sent() in create_additional_requests()
This commit is contained in:
parent
947f31ad96
commit
76ec1c0923
@ -110,7 +110,8 @@ class Task(SQLModel, table=True):
|
|||||||
for _ in range(self.additional_requests_to_be_sent()):
|
for _ in range(self.additional_requests_to_be_sent()):
|
||||||
user = next_user_to_send_request(session, self)
|
user = next_user_to_send_request(session, self)
|
||||||
if user is None:
|
if user is None:
|
||||||
break
|
# Incomplete requests
|
||||||
|
return Err(additional_requests)
|
||||||
|
|
||||||
request = ParticipationRequest(
|
request = ParticipationRequest(
|
||||||
user=user,
|
user=user,
|
||||||
@ -120,11 +121,7 @@ class Task(SQLModel, table=True):
|
|||||||
session.add(request)
|
session.add(request)
|
||||||
additional_requests.append(request)
|
additional_requests.append(request)
|
||||||
|
|
||||||
if user is None:
|
return Ok(additional_requests)
|
||||||
# Incomplete requests
|
|
||||||
return Err(additional_requests)
|
|
||||||
else:
|
|
||||||
return Ok(additional_requests)
|
|
||||||
|
|
||||||
|
|
||||||
class ParticipationState(enum.Enum):
|
class ParticipationState(enum.Enum):
|
||||||
|
Loading…
Reference in New Issue
Block a user