更新用户提交 ac 标志存储方法
This commit is contained in:
@@ -14,14 +14,4 @@ class RichTextField(models.TextField):
|
||||
parser = XssHtml()
|
||||
parser.feed(value)
|
||||
parser.close()
|
||||
return parser.getHtml()
|
||||
|
||||
|
||||
class JsonField(models.TextField):
|
||||
__metaclass__ = models.SubfieldBase
|
||||
|
||||
def get_prep_value(self, value):
|
||||
return json.dumps(value)
|
||||
|
||||
def to_python(self, value):
|
||||
return json.loads(value)
|
||||
return parser.getHtml()
|
||||
@@ -9,6 +9,9 @@ def get_problem_accepted_radio(problem):
|
||||
|
||||
|
||||
def get_problem_status(problems_status, problem_id):
|
||||
# 用户没登陆 或者 user.problem_status 中没有这个字段都会到导致这里的problem_status 为 ""
|
||||
if not problems_status:
|
||||
return ""
|
||||
|
||||
if str(problem_id) in problems_status:
|
||||
if problems_status[str(problem_id)] == 1:
|
||||
@@ -16,6 +19,7 @@ def get_problem_status(problems_status, problem_id):
|
||||
return "glyphicon glyphicon-minus dealing-flag"
|
||||
return ""
|
||||
|
||||
|
||||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
|
||||
Reference in New Issue
Block a user