为User problems_status 添加默认值,并精简了相关代码
This commit is contained in:
19
account/migrations/0003_auto_20150915_2025.py
Normal file
19
account/migrations/0003_auto_20150915_2025.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('account', '0002_user_problems_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='problems_status',
|
||||
field=models.TextField(default=b'{}'),
|
||||
),
|
||||
]
|
||||
@@ -31,8 +31,7 @@ class User(AbstractBaseUser):
|
||||
# 0代表不是管理员 1是普通管理员 2是超级管理员
|
||||
admin_type = models.IntegerField(default=0)
|
||||
# JSON字典用来表示该用户的问题的解决状态 1为ac,2为正在进行
|
||||
problems_status = models.TextField(blank=True)
|
||||
|
||||
problems_status = models.TextField(default="{}")
|
||||
|
||||
USERNAME_FIELD = 'username'
|
||||
REQUIRED_FIELDS = []
|
||||
|
||||
Reference in New Issue
Block a user