diff --git a/Server/app/model/account/student.py b/Server/app/model/account/student.py index 4fa1cce..d5738f2 100644 --- a/Server/app/model/account/student.py +++ b/Server/app/model/account/student.py @@ -36,7 +36,10 @@ def get_student_by_id_email(id: str, email: str) -> 'StudentModel': return student @staticmethod - def signup(id, pw, name, number): + def signup(id, pw, unsigned_student: UnsignedStudentModel): + name = unsigned_student.name + number = unsigned_student.number + if StudentModel.get_student_by_id(id) is not None: raise ResetContentException() diff --git a/Server/app/view/account/signup.py b/Server/app/view/account/signup.py index c2b190d..d42d46d 100644 --- a/Server/app/view/account/signup.py +++ b/Server/app/view/account/signup.py @@ -11,13 +11,15 @@ class Signup(AccountResource): @json_type_validate(SIGNUP_POST_JSON) @swag_from(SIGNUP_POST) def post(self): + uuid = request.json['uuid'] + unsigned_student = UnsignedStudentModel.get_unsigned_student(uuid) + id = request.json['id'] pw = request.json['password'] - unsigned_student = UnsignedStudentModel.get_unsigned_student(uuid) - StudentModel.signup(id, pw, unsigned_student.name, unsigned_student.number) + StudentModel.signup(id, pw, unsigned_student) PointStatusModel(id).save() StayApplyModel(id, 4).save()