swapnilsparsh / Rescue

A women’s safety website that sends emails and messages to your trusted ones.
MIT License
119 stars 186 forks source link

fixed register functionality bug #297

Closed coding-geek21 closed 3 years ago

coding-geek21 commented 3 years ago

Related Issue or bug

Fixes: #

Describe the changes you've made

A clear and concise description of what you have done to successfully close your assigned issue. Any new files? or anything you feel to let us know!

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

A clear and concise description of it.

Checklist:

Screenshots

Original Updated
original screenshot updated screenshot
arpit456jain commented 3 years ago

@coding-geek21 hey I was also thinking about this issue can you please guide me why did you put the condition

if($("#id_username").val() === $("#id_email").val())

unique email and unique username means there should not any duplicate copy of themselves but what's the relation between username and email this condition will never true so the alert will not occur Although the sign in works .

But It doesn't make any sense to me . Correct me If i am getting wrong anything.

Did you check it , by trying to make account with same email again ?

coding-geek21 commented 3 years ago

@coding-geek21 hey I was also thinking about this issue can you please guide me why did you put the condition

if($("#id_username").val() === $("#id_email").val())

unique email and unique username means there should not any duplicate copy of themselves but what's the relation between username and email this condition will never true so the alert will not occur Although the sign in works .

But It doesn't make any sense to me . Correct me If i am getting wrong anything.

Did you check it , by trying to make account with same email again ?

Actually my point of view is anyway this dynamic username functionality is for showing whether the user name and email is available or not using tick and wrong mark , I agree that if($("#id_username").val() === $("#id_email").val()) this is never going to become true I just tried to override by placing that condition , since that only is going to violate the register functionality , and i did this because anyway the django is going to handle it by default when the user tries to register with already existing email and username , so according to me that alert is not necessary and that piece of block is not necessary since it is already checked by django. I will try to give some optimal solution since they have used ajax which i'm not familiar i'm trying to find the correct solution

arpit456jain commented 3 years ago

@coding-geek21 hey I was also thinking about this issue can you please guide me why did you put the condition if($("#id_username").val() === $("#id_email").val()) unique email and unique username means there should not any duplicate copy of themselves but what's the relation between username and email this condition will never true so the alert will not occur Although the sign in works . But It doesn't make any sense to me . Correct me If i am getting wrong anything. Did you check it , by trying to make account with same email again ?

Actually my point of view is anyway this dynamic username functionality is for showing whether the user name and email is available or not using tick and wrong mark , I agree that if($("#id_username").val() === $("#id_email").val()) this is never going to become true I just tried to override by placing that condition , since that only is going to violate the register functionality , and i did this because anyway the django is going to handle it by default when the user tries to register with already existing email and username , so according to me that alert is not necessary and that piece of block is not necessary since it is already checked by django. I will try to give some optimal solution since they have used ajax which i'm not familiar i'm trying to find the correct solution

ok . Actually I have seen this feature in many projects the code is exactly the same , may be the same person added this 😅 But They did not contain this alert part so i think you can remove that if - else containing alert its of no use

github-actions[bot] commented 3 years ago

Thank you @coding-geek21 for your contribution. Looking forward for more such amazing contributions :)

github-actions[bot] commented 3 years ago

Thank you @coding-geek21 for your contribution. Looking forward for more such amazing contributions :)