个人信息中的学校改为选填

This commit is contained in:
virusdefender 2016-05-13 12:12:50 +08:00
parent 0f7c853783
commit 4737e970f5
No known key found for this signature in database
GPG Key ID: 1686FB5677979E61
3 changed files with 3 additions and 12 deletions

View File

@ -21,7 +21,7 @@ class EmailCheckSerializer(serializers.Serializer):
class UserRegisterSerializer(serializers.Serializer):
username = serializers.CharField(max_length=30)
real_name = serializers.CharField(max_length=30)
school = serializers.CharField(max_length=200)
school = serializers.CharField(max_length=200, required=False, default=None)
password = serializers.CharField(max_length=30, min_length=6)
email = serializers.EmailField(max_length=254)
captcha = serializers.CharField(max_length=4, min_length=4)

View File

@ -31,14 +31,6 @@ require(["jquery", "bsAlert", "csrfToken", "validator"], function ($, bsAlert, c
return false;
}
});
$("#school").blur(function () {
var school = $("#school").val().trim(school).toLowerCase();
if (school == "青岛大学" || school == "qdu" || school == "青大") {
$("#stu_id").show();
$("#school").val("青岛大学");
}
});
function refresh_captcha() {
$("#captcha-img")[0].src = "/captcha/?" + Math.random();
$("#captcha")[0].value = "";

View File

@ -20,10 +20,9 @@
</div>
<div class="form-group">
<label for="school">学校</label>
<input type="text" class="form-control input-lg" id="school" name="school" placeholder="学校" data-error="请填写学校" required>
<div class="help-block with-errors"></div>
<input type="text" class="form-control input-lg" id="school" name="school" placeholder="非必填,如果你需要使用课程功能,请填写该字段">
</div>
<div class="form-group" id="stu_id">
<div class="form-group">
<label for="student_id">学号</label>
<input type="number" class="form-control input-lg" id="student_id" name="student_id" placeholder="非必填,如果你需要使用课程功能,请填写该字段">
</div>