Mbonea commited on
Commit
73e6f48
·
1 Parent(s): 3ec99ba
Files changed (1) hide show
  1. App/Users/Model.py +5 -7
App/Users/Model.py CHANGED
@@ -126,8 +126,6 @@ class User(models.Model):
126
  hashed_password = pwd_context.hash(plain_password)
127
  user_data["password"] = hashed_password
128
 
129
-
130
-
131
  # Register with AndroidClient
132
  register_request = AndroidRegister(
133
  password=plain_password, # Assuming AndroidClient expects plain password
@@ -138,17 +136,17 @@ class User(models.Model):
138
  request=register_request
139
  )
140
  logger.info(
141
- f"AndroidClient register_user response for {user_data["phoneNumber"]}: {response}"
142
  )
143
  except Exception as e:
144
  logger.error(
145
- f"Failed to register user with AndroidClient for {user_data["phoneNumber"]}: {e}"
146
  )
147
- # Create the user in the database
148
  new_user = await cls.create(**user_data)
149
  logger.info(f"User {new_user.phoneNumber} created successfully.")
150
- # Decide whether to rollback user creation or proceed
151
- # For simplicity, we'll proceed
152
 
153
  # Send welcome message
154
  await new_user.send_welcome_message()
 
126
  hashed_password = pwd_context.hash(plain_password)
127
  user_data["password"] = hashed_password
128
 
 
 
129
  # Register with AndroidClient
130
  register_request = AndroidRegister(
131
  password=plain_password, # Assuming AndroidClient expects plain password
 
136
  request=register_request
137
  )
138
  logger.info(
139
+ f"AndroidClient register_user response for {user_data['phoneNumber']}: {response}"
140
  )
141
  except Exception as e:
142
  logger.error(
143
+ f"Failed to register user with AndroidClient for {user_data['phoneNumber']}: {e}"
144
  )
145
+ # Create the user in the database
146
  new_user = await cls.create(**user_data)
147
  logger.info(f"User {new_user.phoneNumber} created successfully.")
148
+ # Decide whether to rollback user creation or proceed
149
+ # For simplicity, we'll proceed
150
 
151
  # Send welcome message
152
  await new_user.send_welcome_message()