From 3f4a51d8c84455a3fbe473418396932f6ce3624d Mon Sep 17 00:00:00 2001 From: "beetles-ai[bot]" <221859081+beetles-ai[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 12:46:00 +0000 Subject: [PATCH] Patch for controllers/auth.py --- controllers/auth.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/controllers/auth.py b/controllers/auth.py index 080fdc1..dc143b1 100644 --- a/controllers/auth.py +++ b/controllers/auth.py @@ -56,15 +56,18 @@ async def create_user(user_data: UserRegister): # Hash the password hashed_password = bcrypt.hashpw(user_data.password.encode('utf-8'), bcrypt.gensalt()) - try: - # Create a new user - user = await db.user.create( - data={ - 'email': user_data.email, - 'name': user_data.name, - 'password': hashed_password.decode('utf-8'), - } - ) +try: +# Create a new user +user = await db.user.create( +data={ +'email': user_data.email, +'name': user_data.name, +'password': hashed_password.decode('utf-8'), +} +) +except Exception as e: +print(f"Error creating user: {e}") +raise HTTPException(status_code=500, detail="Failed to create user") # Create default job statuses for status in DEFAULT_STATUSES: