mirror of
https://github.com/Xevion/contest-assistant.git
synced 2026-01-31 20:23:47 -06:00
add permission/cooldown checks, implement permission setting logic, fix state not being advanced, fix guild.submission disparity and use proper typehinting to catch errors like this
This commit is contained in:
+2
-1
@@ -97,7 +97,7 @@ class Period(Base):
|
||||
"""
|
||||
Advances the current recorded state of this Period, recording timestamps as needed.
|
||||
"""
|
||||
next_state = PeriodStates(int(self.state) + 1)
|
||||
next_state = PeriodStates(self.state.value + 1)
|
||||
if self.state == PeriodStates.READY:
|
||||
self.submissions_time = datetime.datetime.utcnow()
|
||||
elif self.state == PeriodStates.SUBMISSIONS:
|
||||
@@ -109,6 +109,7 @@ class Period(Base):
|
||||
self.completed = True
|
||||
self.active = False
|
||||
|
||||
self.state = next_state
|
||||
return next_state
|
||||
|
||||
@check_not_finished
|
||||
|
||||
Reference in New Issue
Block a user