update to django 2.0

This commit is contained in:
virusdefender
2019-03-11 11:25:10 +08:00
parent f7bd9f16b4
commit 6b7654a0c3
18 changed files with 69 additions and 53 deletions

View File

@@ -25,7 +25,7 @@ class PickOneAPI(APIView):
class ProblemAPI(APIView):
@staticmethod
def _add_problem_status(request, queryset_values):
if request.user.is_authenticated():
if request.user.is_authenticated:
profile = request.user.userprofile
acm_problems_status = profile.acm_problems_status.get("problems", {})
oi_problems_status = profile.oi_problems_status.get("problems", {})
@@ -81,7 +81,7 @@ class ProblemAPI(APIView):
class ContestProblemAPI(APIView):
def _add_problem_status(self, request, queryset_values):
if request.user.is_authenticated():
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", {})