gabekutner / roommatefinder-backend

Welcome to DormParty: a social platform for college kids looking for dorm roommates. Help out with the first version of RoommateFinder by sharing feedback and contributing to the code.
https://gabekutner.github.io/roommatefinder-mobile/
Apache License 2.0
1 stars 2 forks source link

🔃 Refactor sending otp codes #11

Open gabekutner opened 3 months ago

gabekutner commented 3 months ago

A user signs up with an identifier through post request to api/v1/profiles/.

This creates a Profile model and sends a post_save signal.

The post_save signal sends a 4 digit otp verification code to the provided identifier.

The signal was written quickly and isn't great code. Rewrite the signal to

1) only send otp codes if the otp_verified Profile model attribute is false 2) rewrite the signal code

Related files

gabekutner commented 3 months ago

Another perfectly valid fix to this is moved the creation of an otp code to the views file. Signals are out of date, so create a file for making and sending otp codes, and implement it into the necessary views.