Update auth.py
Browse files
auth.py
CHANGED
@@ -45,7 +45,7 @@ from emailx import send_verification_email, generate_verification_token
|
|
45 |
|
46 |
def register(self, user: UserCreate, db: Session = Depends(get_db)):
|
47 |
# Validate email format and check for existing users
|
48 |
-
db_user =
|
49 |
if db_user:
|
50 |
raise HTTPException(status_code=400, detail="Email already registered")
|
51 |
|
|
|
45 |
|
46 |
def register(self, user: UserCreate, db: Session = Depends(get_db)):
|
47 |
# Validate email format and check for existing users
|
48 |
+
db_user = get_user_by_email(db, user.email)
|
49 |
if db_user:
|
50 |
raise HTTPException(status_code=400, detail="Email already registered")
|
51 |
|