From 976204c703ea55e9ab0b45f3cc6ef828e02a88af Mon Sep 17 00:00:00 2001 From: KIM JUNG BIN Date: Thu, 3 Mar 2022 16:20:54 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=EC=9D=B4=EC=A0=84=20=EB=B0=A9=EC=8B=9D=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/app/model/account/student.py | 5 ++++- Server/app/view/account/signup.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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()