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:
Xevion
2021-02-13 18:31:38 -06:00
parent 9e889d8c8c
commit 28d7768340
2 changed files with 72 additions and 39 deletions
+2 -1
View File
@@ -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