models/ParticipationRequest: fix return types of try_reject()

This commit is contained in:
lemoer 2024-12-27 01:22:28 +01:00
parent bda6457547
commit 00d16561d5

View File

@ -239,7 +239,7 @@ class ParticipationRequest(SQLModel, table=True):
else:
raise Exception("Unknown old state " + str(self.state) + ".")
def try_reject(self, now: datetime.datetime) -> Result[RejectInTime, RejectAfterAccept | RejectAfterTimeout]:
def try_reject(self, now: datetime.datetime) -> Result[RejectInTime | RejectAfterAccept, AlreadyRejected | RejectAfterTimeout]:
if self.state == ParticipationState.REQUESTED or self.state == ParticipationState.TIMEOUT:
# We want to make the order in which check_for_timeout() and try_reject() is called irrelevant
if self.is_timed_out(now):