修改用户题目 ac 状态的存储方式

This commit is contained in:
virusdefender
2015-09-24 15:28:55 +08:00
parent 7eea999277
commit 44d094f19c
3 changed files with 6 additions and 17 deletions

View File

@@ -305,15 +305,11 @@ def problem_list_page(request, page=1):
except Exception:
pass
if request.user.is_authenticated():
problems_status = json.loads(request.user.problems_status)
else:
problems_status = {}
# 右侧标签列表 按照关联的题目的数量排序 排除题目数量为0的
tags = ProblemTag.objects.annotate(problem_number=Count("problem")).filter(problem_number__gt=0).order_by("-problem_number")
return render(request, "oj/problem/problem_list.html",
{"problems": current_page, "page": int(page),
"previous_page": previous_page, "next_page": next_page,
"keyword": keyword, "tag": tag_text,"problems_status": problems_status,
"keyword": keyword, "tag": tag_text,
"tags": tags, "difficulty_order": difficulty_order})