diff --git a/mo/rights.py b/mo/rights.py index 3007956631e416330d7fa4d53f0727f83e6c4c35..9f3ab0842aa6d0758e1c49c128162acaa022103f 100644 --- a/mo/rights.py +++ b/mo/rights.py @@ -326,20 +326,17 @@ class RoundRights(Rights): def _is_configured(self) -> bool: return self._get_state() != db.RoundState.preparing - def _is_active(self) -> bool: - return self._get_state() not in [db.RoundState.preparing, db.RoundState.closed] - def offer_upload_solutions(self) -> bool: return (self.have_right(Right.upload_submits) and self._is_configured() - or (self.have_right(Right.upload_solutions) and self._is_active())) + or self.have_right(Right.upload_solutions) and self._get_state() in [db.RoundState.running, db.RoundState.delegate]) def offer_upload_feedback(self) -> bool: return (self.have_right(Right.upload_submits) and self._is_configured() - or (self.have_right(Right.upload_feedback) and self._is_active())) + or self.have_right(Right.upload_feedback) and self._get_state() in [db.RoundState.grading, db.RoundState.graded, db.RoundState.delegate]) def offer_edit_points(self) -> bool: - return (self.have_right(Right.manage_contest) and self._is_configured() - or (self.have_right(Right.edit_points) and self._is_active())) + return (self.have_right(Right.edit_points) and self._get_state() in [db.RoundState.grading, db.RoundState.graded, db.RoundState.delegate] + or self.have_right(Right.manage_contest) and self._is_configured()) def can_upload_solutions(self) -> bool: return (self.have_right(Right.upload_submits) and self._is_configured()