Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify email #275

Merged
merged 46 commits into from
May 12, 2021
Merged

Verify email #275

merged 46 commits into from
May 12, 2021

Conversation

Freshrojek
Copy link
Contributor

Think this branch is ready enough.
I have updated the email sending view to now send through celery using the tasks.py file.
To send a verification email you need to set the appropriate settings in your environment for email, then sign up and on the member_details page there will be a button to send a verification email.
If you are already verified, the button will no longer be there and you can see the email verified field to the member model is updated.

@Freshrojek Freshrojek requested a review from a team as a code owner April 16, 2021 14:28
@Freshrojek
Copy link
Contributor Author

I have a test email if anyone wants the information

@Freshrojek Freshrojek linked an issue Apr 16, 2021 that may be closed by this pull request
@Freshrojek Freshrojek added the pre-go-live Required for MVP label Apr 16, 2021
Copy link
Contributor

@SamWinterhalder SamWinterhalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far!
A few small things though which I think need a little bit of tweaking.

memberships/models.py Outdated Show resolved Hide resolved
memberships/views.py Outdated Show resolved Hide resolved
@SamWinterhalder
Copy link
Contributor

One other thing - I think .idea should be added to .gitignore as from what I understand it is for your local project settings.

@SamWinterhalder
Copy link
Contributor

SamWinterhalder commented Apr 16, 2021

Sorry to keep mentioning stuff but I also think that all the functions made for the email verification should be moved to its own file. views.py is inteded to only contain a function for each webpage. Or are these the views?

@Freshrojek
Copy link
Contributor Author

One other thing - I think .idea should be added to .gitignore as from what I understand it is for your local project settings.

Good idea

@Freshrojek
Copy link
Contributor Author

Sorry to keep mentioning stuff but I also think that all the functions made for the email verification should be moved to its own file. views.py is inteded to only contain a function for each webpage. Or are these the views?

The more suggestions the better :) yeah it's only used once but after you mentioned it it probably would be best to have it in a file separately.

@Freshrojek
Copy link
Contributor Author

@SamWinterhalder Actually, I'm not too sure now as they are both the views for verify_sent.html and verify_confirmation.html

Copy link
Contributor

@SamWinterhalder SamWinterhalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I think that post MVP we should look at limiting the rate/amount of time the user can request the verficiation email but that is not for now.

@Freshrojek
Copy link
Contributor Author

Good idea, should I log a ticket for it?

@Freshrojek
Copy link
Contributor Author

gonna have to rebase before merging because all commits need to be signed, so I might need you to look again after rebase lol

@SamWinterhalder
Copy link
Contributor

Erm, there are a lot of duplicate commits 😅

Could ya cherry-pick please xD

@Freshrojek Freshrojek force-pushed the verify-email branch 2 times, most recently from 9710781 to 47904e7 Compare April 19, 2021 13:00
@Freshrojek
Copy link
Contributor Author

There we go, just got myself in and out of a fine hot git mess 😰

@Freshrojek Freshrojek linked an issue Apr 20, 2021 that may be closed by this pull request
@Freshrojek
Copy link
Contributor Author

Just added the welcome email quickly as it needs the celery set-up I have used for the verification email

@Freshrojek
Copy link
Contributor Author

Since rebasing the celery worker receives the task but it stops there, task_send_email doesn't log or send an email anymore.

@Freshrojek
Copy link
Contributor Author

and I always keep getting redirected to confirm.html whatever I do

@SamWinterhalder
Copy link
Contributor

and I always keep getting redirected to confirm.html whatever I do

See #282

@SamWinterhalder
Copy link
Contributor

SamWinterhalder commented Apr 21, 2021

Emails seem to have been sent for me:

image

Geek.Zone/Bot and others added 21 commits May 12, 2021 09:27
…n. email-verification seems to be easier but when using get_user_model I'm getting a UNIQUE constraint failed: auth_user.username error
…tting the object of the user rather than creating duplicate objects. Next task for this is to get the links and token verification working. Also details for test email i set up are exposed in settings
…n. email-verification seems to be easier but when using get_user_model I'm getting a UNIQUE constraint failed: auth_user.username error
Completed the email verification process now, by using my own method rather than the Django-email-verification or Django-verify-email it means the verification doesn't rely on the user being active or not. This means we can request to verify email through a button on the details page - which is now done.
Now have a template for when the email sends, and sending the email through celery (need to test though)
Updated __init__.py to ensure celery runs on start up, added a broker URL in the settings for celery to use and updated calling the task to send an email in tasks.py instead of using send_mail
Used the migration files from master to generate the same workspace file for pycharm
Updated the duplicate in models, removed the commented @login_required() and added the .idea/ folder to .gitignore
Un-commented recaptcha function
Corrected variable name passed into the html message
Added it under `exclude` so that the user can't change the field manually without verifying their email
@Freshrojek
Copy link
Contributor Author

all rebased @jamesgeddes :)

@Freshrojek Freshrojek merged commit e77a182 into master May 12, 2021
@Freshrojek Freshrojek deleted the verify-email branch July 24, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre-go-live Required for MVP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Welcome email Verify email
3 participants