forked from LeineLab-Public/lab-signal-bot
models/ParticipationRequest: fix return types of try_reject()
This commit is contained in:
parent
bda6457547
commit
00d16561d5
@ -239,7 +239,7 @@ class ParticipationRequest(SQLModel, table=True):
|
|||||||
else:
|
else:
|
||||||
raise Exception("Unknown old state " + str(self.state) + ".")
|
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:
|
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
|
# We want to make the order in which check_for_timeout() and try_reject() is called irrelevant
|
||||||
if self.is_timed_out(now):
|
if self.is_timed_out(now):
|
||||||
|
Loading…
Reference in New Issue
Block a user