针对添加学号字段对页面的一些修改,注册是学校为青岛大学则显示学号字段,在user settings页面显示学号,并提供修改
This commit is contained in:
@@ -97,7 +97,7 @@ class UserRegisterAPIView(APIView):
|
||||
email=data["email"])
|
||||
user.set_password(data["password"])
|
||||
user.save()
|
||||
UserProfile.objects.create(user=user, school=data["school"])
|
||||
UserProfile.objects.create(user=user, school=data["school"], student_id=data["student_id"])
|
||||
return success_response(u"注册成功!")
|
||||
else:
|
||||
return serializer_invalid_response(serializer)
|
||||
@@ -262,6 +262,7 @@ class UserProfileAPIView(APIView):
|
||||
user_profile.codeforces_username = data["codeforces_username"]
|
||||
user_profile.blog = data["blog"]
|
||||
user_profile.school = data["school"]
|
||||
user_profile.student_id = data["student_id"]
|
||||
user_profile.phone_number = data["phone_number"]
|
||||
user_profile.save()
|
||||
return success_response(u"修改成功")
|
||||
|
||||
Reference in New Issue
Block a user