remove contest type

This commit is contained in:
2026-05-26 23:10:27 -06:00
parent 6b81856bfd
commit 6ab2886f77
12 changed files with 69 additions and 213 deletions

View File

@@ -3,7 +3,7 @@ import hashlib
import inspect
import time
from contest.models import Contest, ContestRuleType, ContestStatus, ContestType
from contest.models import Contest, ContestStatus, ContestType
from problem.models import Problem
from utils.api import APIError, JSONResponse
from utils.constants import CONTEST_PASSWORD_SESSION_KEY
@@ -139,11 +139,6 @@ def check_contest_permission(check_type="details"):
if self.contest.status == ContestStatus.CONTEST_NOT_START and check_type != "details":
return self.error("Contest has not started yet.")
# check does user have permission to get ranks, submissions in OI Contest
if self.contest.status == ContestStatus.CONTEST_UNDERWAY and self.contest.rule_type == ContestRuleType.OI:
if not self.contest.real_time_rank and (check_type == "ranks" or check_type == "submissions"):
return self.error(f"No permission to get {check_type}")
return func(*args, **kwargs)
return _check_permission
return decorator