mayureshagashe2105 commited on
Commit
8dbdcd8
·
1 Parent(s): 9e0a325

Update TechdocsAPI/backend/services/auth/ops.py

Browse files
TechdocsAPI/backend/services/auth/ops.py CHANGED
@@ -44,19 +44,19 @@ async def ops_signup(bgtasks: BackgroundTasks, response_result: GeneralResponse,
44
  "template_kwargs": email_body_params
45
  }
46
 
47
- status = post_request(url=config.MAIL_SERVER_URL, data=details, headers=None)
48
- if status != 200:
49
- raise EmailNotSentException()
50
 
51
 
52
 
53
- DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password), "", 0),
54
  ['username', 'password', 'email', 'is_verified'])
55
 
56
 
57
 
58
  response_result.status = 'success'
59
- response_result.message = [f'Activate your account by clicking on the link sent to {data.email}.\nMake sure to check your spam folder.']
60
 
61
  def ops_login(data:LoginCreds):
62
  """Wrapper method to handle login process.
@@ -85,8 +85,8 @@ def ops_login(data:LoginCreds):
85
  # password is incorrect
86
  raise InvalidCredentialsException(response_result)
87
 
88
- if not user[2]:
89
- raise EmailNotVerifiedException()
90
 
91
  # password is correct
92
  return TokenSchema(access_token=Auth.create_access_token(data.username),
 
44
  "template_kwargs": email_body_params
45
  }
46
 
47
+ # status = post_request(url=config.MAIL_SERVER_URL, data=details, headers=None)
48
+ # if status != 200:
49
+ # raise EmailNotSentException()
50
 
51
 
52
 
53
+ DBQueries.insert_to_database('auth', (data.username, Auth.get_password_hash(data.password), data.email, 1),
54
  ['username', 'password', 'email', 'is_verified'])
55
 
56
 
57
 
58
  response_result.status = 'success'
59
+ # response_result.message = [f'Activate your account by clicking on the link sent to {data.email}.\nMake sure to check your spam folder.']
60
 
61
  def ops_login(data:LoginCreds):
62
  """Wrapper method to handle login process.
 
85
  # password is incorrect
86
  raise InvalidCredentialsException(response_result)
87
 
88
+ # if not user[2]:
89
+ # raise EmailNotVerifiedException()
90
 
91
  # password is correct
92
  return TokenSchema(access_token=Auth.create_access_token(data.username),