remove contest type
This commit is contained in:
@@ -292,9 +292,6 @@ class ContestProblemAPI(ProblemBase):
|
||||
except Contest.DoesNotExist:
|
||||
return self.error("Contest does not exist")
|
||||
|
||||
if data["rule_type"] != contest.rule_type:
|
||||
return self.error("Invalid rule type")
|
||||
|
||||
_id = data["_id"]
|
||||
if not _id:
|
||||
return self.error("Display ID is required")
|
||||
@@ -360,9 +357,6 @@ class ContestProblemAPI(ProblemBase):
|
||||
except Contest.DoesNotExist:
|
||||
return self.error("Contest does not exist")
|
||||
|
||||
if data["rule_type"] != contest.rule_type:
|
||||
return self.error("Invalid rule type")
|
||||
|
||||
problem_id = data.pop("id")
|
||||
|
||||
try:
|
||||
|
||||
@@ -6,7 +6,6 @@ from django.utils import timezone
|
||||
|
||||
from account.decorators import check_contest_permission
|
||||
from account.models import User
|
||||
from contest.models import ContestRuleType
|
||||
from submission.models import JudgeStatus, Submission
|
||||
from utils.api import APIView, AsyncAPIView
|
||||
from utils.async_helpers import async_cache_get, async_cache_set
|
||||
@@ -149,10 +148,7 @@ class ContestProblemAPI(APIView):
|
||||
def _add_problem_status(self, request, queryset_values):
|
||||
if request.user.is_authenticated:
|
||||
profile = request.user.userprofile
|
||||
if self.contest.rule_type == ContestRuleType.ACM:
|
||||
problems_status = profile.acm_problems_status.get("contest_problems", {})
|
||||
else:
|
||||
problems_status = profile.oi_problems_status.get("contest_problems", {})
|
||||
problems_status = profile.acm_problems_status.get("contest_problems", {})
|
||||
for problem in queryset_values:
|
||||
problem["my_status"] = problems_status.get(str(problem["id"]), {}).get("status")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user