Closed JpadillaCoding closed 1 day ago
@Joshua-Douglas I took your advice and used remove_user to avoid duplicate logic. To avoid the errors you mentioned and to also make the function more flexible for future uses, I made the deletion from cognito and the DB separate by specifying which to do on the parameters. I also set deleting from both as default as most use cases would call for the deletion of both. Let me know what you think of this approach.
As far as the test you provided, it worked fine as is and didn't need any modifications. The test failed without remove_user implemented on the case errors and passed after it was implemented.
Thanks!
@tylerthome @paulespinosa @Joshua-Douglas Hey all. Thanks for your feedback! I've addressed the concerns pointed out 😄
Closes #565
What changes did you make?
Rationale behind the changes?
session.rollback
method could be used. I found that this made the code harder to read since it added more nesting of try and except blocks.Errors
sectionTesting done for these changes
Password=body['password']
--->Password='lol'
This invoked the'InvalidPasswordException'
case and verified the email deletion worked.What did you learn or can share that is new?
Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Visuals before changes are applied
![image](Paste_Your_Image_Link_Here_After_Attaching_Files)Visuals after changes are applied
![image](Paste_Your_Image_Link_Here_After_Attaching_Files)