Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Add task using Celery to send email verification for reset password #1030

Open
4 tasks
keshakaneria opened this issue Aug 24, 2020 · 38 comments
Open
4 tasks
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Type: Enhancement New feature or request.

Comments

@keshakaneria
Copy link
Member

keshakaneria commented Aug 24, 2020

Description

In order to login into the system using forgot password, I need to verify my email address to get logged in to change the old password with the new one. Currently, the email is displayed in the console itself.

Acceptance Criteria

Update [Required]

  • Add tasks using Celery
  • Email should be sent to the email address along with printing it in console.

Celery is an asynchronous task scheduler which helps to run different process in background which can be used here in order to create tasks for mailing system.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Estimation

3 hours

@keshakaneria keshakaneria added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Type: Enhancement New feature or request. labels Aug 24, 2020
@SanketDG
Copy link

@keshakaneria That is intentional because that's how Django's ConsoleHandler works, if the right SMTP credentials are passed in, then it would use SMTP to send the email.

As for using celery, I don't find a strong reason as to why should we send one simple email using Celery. Feel free to prove me wrong.

@keshakaneria
Copy link
Member Author

keshakaneria commented Aug 26, 2020

@SanketDG I wanted to use an 'Asynchronous task' where the mail will be sent in background and in the interface the according message will be displayed. Not using it will make the website keep loading until the mail through SMTP would send and then return the next step.
If you have any suggestions or if i am wrong then do let me know, I will change the issue accordingly 😄

@keshakaneria
Copy link
Member Author

Sorry, by mistake I closed the issue. Its opened again.

@SanketDG
Copy link

SanketDG commented Aug 26, 2020

Not using it will make the website keep loading until the mail through SMTP would send and then return the next step.

That's fair, although sending one email would be mostly trivial, I am just not sure whether a highly cohesive dependency like Celery is worth it or not, most of the applications I have seen are for a large number of asynchronous tasks, that's where it really shines.

This is definitely a valid issue though, let's see what other mentors think about this!

@keshakaneria
Copy link
Member Author

Sure, thank you so much for letting me brainstorm again on this issue.

@satya7289
Copy link
Contributor

@keshakaneria We can use cronjob.

@saideepesh000
Copy link
Contributor

OSH, Can I work on it.

@saideepesh000
Copy link
Contributor

@keshakaneria, can I use this Password Reset View, to reset the password without celery, as I don't have any experience using celery.

@keshakaneria
Copy link
Member Author

@saideepesh000 Yes you can, unless and until it covers the main goal of the issue to send a mail and also displaying it in console to verify and reset the password successfully.

@saideepesh000
Copy link
Contributor

@keshakaneria, Actually reset password section is already present on the website. and it's working.

Screenshot (269)

@keshakaneria
Copy link
Member Author

@saideepesh000 you dont have to include the code of its working. As you said the flow is absolutely perfect. What the aim of this issue to get the verification email on the mail id which is entered. Currently it is displayed in console, so in addition we need to get the mail in the id itself.

@saideepesh000
Copy link
Contributor

@keshakaneria, Please once take a look at this,

@keshakaneria
Copy link
Member Author

@keshakaneria, Please once take a look at this,

You edited and added your code to send the verification mail right? Seems perfect to me. Great job 👍

@saideepesh000
Copy link
Contributor

@keshakaneria, Please once take a look at this,

You edited and added your code to send the verification mail right? Seems perfect to me. Great job 👍

@keshakaneria, I just actually added only a few lines i.e to configure SMTP mail. Should I send a PR, so that you could understand it more?

@keshakaneria
Copy link
Member Author

Yes @saideepesh000 you can.

@keshakaneria
Copy link
Member Author

keshakaneria commented Sep 6, 2020

@saideepesh000 Any updates on PR?

@saideepesh000
Copy link
Contributor

@saideepesh000 Any updates on PR?

Actually I am busy with the placements going on, it'll be done in a day or two.

@keshakaneria
Copy link
Member Author

You can report me the updates done by you, else I will have to unassign you, since it has been 10 days this issue is assigned to you.

@saideepesh000
Copy link
Contributor

Sorry for the inconvenience, I may not be working for a while, till then assign this issue to someone else, I'd joining you, after all my things got finished (professional and personal).

@keshakaneria
Copy link
Member Author

Sorry for the inconvenience, I may not be working for a while, till then assign this issue to someone else, I'd joining you, after all my things got finished (professional and personal).

Okay thank you. Is anyone else ready to work on this issue?

@kritikaparmar-programmer

Hey @keshakaneria , I've worked with reset passwords in Django but with with celery..

@keshakaneria
Copy link
Member Author

Hey @keshakaneria , I've worked with reset passwords in Django but with with celery..

You can try your hand on this isue then. Go for it.

@kritikaparmar-programmer

Hey @keshakaneria , I wanted to say not with celery..😅

@keshakaneria
Copy link
Member Author

Hey @keshakaneria , I wanted to say not with celery..😅

So in the work you've previously learn is reset password as you said. Do that fulfill our requirements of sending the mail to the id? Currently it is getting displayed in console so along with this, we need to send it to the mail too. You can read the mentioned issue I have tagged here in above comments, you will get an idea.

@kritikaparmar-programmer

Actually we will just need the emailid and password of the gmail id from which we want to send email and then by doing some changes in settings.py we can easily send the email for password reset.. Then email will be sent to user's id which will have the link to change password..
I have worked like this.. @keshakaneria ..

@keshakaneria
Copy link
Member Author

Actually we will just need the emailid and password of the gmail id from which we want to send email and then by doing some changes in settings.py we can easily send the email for password reset.. Then email will be sent to user's id which will have the link to change password..
I have worked like this.. @keshakaneria ..

That is also fine. I am saying that you do the changes according to the requirements and open a PR, then let me know the output of sending the mail to their inbox.

@priyanshurohilla
Copy link

@keshakaneria If this issue is open for reassignment, please assign it to me

@Aaishpra
Copy link
Member

Aaishpra commented Oct 6, 2020

@keshakaneria can i try working on this?

@keshakaneria
Copy link
Member Author

@Aaishpra Sure go for it.

@Aaishpra
Copy link
Member

Aaishpra commented Oct 7, 2020

@keshakaneria just wanted to know if this issue has to be solved using celery only?

@keshakaneria
Copy link
Member Author

@keshakaneria just wanted to know if this issue has to be solved using celery only?

Yes @Aaishpra

@Aaishpra
Copy link
Member

Aaishpra commented Oct 7, 2020

@keshakaneria just wanted to know if this issue has to be solved using celery only?

Yes @Aaishpra

Thanks for clarifying 😄

@Aaishpra
Copy link
Member

@keshakaneria Update: i am half way through the solution of this issue. But, since my mid semester exams are scheduled in a week so would be busy with them. Therefore i think i would require a bit more time to solve this and make the PR. Hope, you consider this.

@keshakaneria
Copy link
Member Author

@Aaishpra I hope you are good to go now :)

@Aaishpra
Copy link
Member

Aaishpra commented Nov 1, 2020

@Aaishpra I hope you are good to go now :)

Aah, sorry for no updates@keshakaneria i am done with my exams and will update you with the PR soon😅

@Aaishpra
Copy link
Member

Aaishpra commented Nov 3, 2020

@keshakaneria well I tried lots of different approaches for solving this issue with celery (or even SMTP) but couldn't get the desired results. So, I am unassigning from this as I have already wasted a lot of your time, please make it available for others. Apologies again.

@Aaishpra Aaishpra removed their assignment Nov 3, 2020
@keshakaneria
Copy link
Member Author

@keshakaneria well I tried lots of different approaches for solving this issue with celery (or even SMTP) but couldn't get the desired results. So, I am unassigning from this as I have already wasted a lot of your time, please make it available for others. Apologies again.

Ahh.. no worries! That is fine. I hope you've learnt alot while researching to work things out! Others issues are open you for you :)

@Aaishpra
Copy link
Member

Aaishpra commented Nov 3, 2020

@keshakaneria well I tried lots of different approaches for solving this issue with celery (or even SMTP) but couldn't get the desired results. So, I am unassigning from this as I have already wasted a lot of your time, please make it available for others. Apologies again.

Ahh.. no worries! That is fine. I hope you've learnt alot while researching to work things out! Others issues are open you for you :)

Ya sure😊 i really learnt a lot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Type: Enhancement New feature or request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants