def update_problem_status(self):
        with transaction.atomic():
            problem = Problem.objects.select_for_update().get(id=self.submission.problem_id)
            # 更新普通题目的计数器
            problem.add_submission_number()

            # 更新用户做题状态
            user = User.objects.select_for_update().get(id=self.submission.user_id)

            problems_status = user.problems_status
            if problems_status not in "problems":
                problems_status["problems"] = {}

            # 增加用户提交计数器
            user.userprofile.add_submission_number()

            # 之前状态不是ac, 现在是ac了 需要更新用户ac题目数量计数器,这里需要判重
            if problems_status["problems"].get(str(problem.id), -1) != 1 and self.submission.result == result["accepted"]:
                user.userprofile.add_accepted_problem_number()

            if self.submission.result == result["accepted"]:
                problem.add_ac_number()
                problems_status["problems"][str(problem.id)] = 1
            else:
                problems_status["problems"][str(problem.id)] = 2
            user.problems_status = problems_status
            user.save(update_fields=["problems_status"])
        # 普通题目的话，到这里就结束了
dataset/ETHPy150Open QingdaoU/OnlineJudge/judge_dispatcher/tasks.py/JudgeDispatcher.update_problem_status/swapped operands of `not in`