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

#161967010 Verify User Registration through Email #16

Merged
merged 1 commit into from
Dec 10, 2018

Conversation

fabzer0
Copy link
Contributor

@fabzer0 fabzer0 commented Dec 6, 2018

What does this PR do?

  • This PR verifies a new user during registration.

Description of Task to be completed?

  • When a new user signs up, they get an email together with a link to a page that will verify them.
  • On clicking, if the link is valid, verification will be successful. The reverse is also True.

How should this be manually tested?

  1. git clone this repo to your local machine.
  2. install virtual environment and activate it inside the directory created.
  3. run pip install -r requirements.txt
  4. include the following in the .env file:
DATABASE_URL="postgres://<username>:<password>@localhost/<dbname>"
export PROTOCOL="http://"
export EMAIL_HOST_USER="<jumanjidevs32@gmail.com>"
export EMAIL_HOST_PASSWORD="<jumanji@32>"
DEBUG=True
  1. run python manage.py makemigrations && python manage.py migrate.
  2. run python manage.py runserver and navigate to the link below.
  3. By using postman, input the following URL:
    http://localhost:8000/api/users/register
  4. Input user data that is the username, email and password wrapped in another
    dictionary with user.
  5. Click send and an email will be sent. Click on the link and you will be navigated
    to the page where your activation will occur. If activation is successful, the message,
    Activation is successful will be returned else, Activation link is invalid.

Any background context you want to provide?

What are the relevant pivotal tracker stories?

#161967010

Screenshots (if appropriate)

screenshot 2018-12-06 at 14 03 15

----------------------------------------------***---------------------------------------------------

screenshot 2018-12-06 at 14 05 34

Questions:

Checklist:

  • My code follows the style guidelines of this project
  • At least 2 people have reviewed my PR
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My PR has one commit.

authors/apps/authentication/views.py Show resolved Hide resolved
authors/apps/authentication/urls.py Show resolved Hide resolved
authors/apps/authentication/urls.py Outdated Show resolved Hide resolved
authors/apps/authentication/confirmation.py Show resolved Hide resolved
authors/apps/authentication/confirmation.py Outdated Show resolved Hide resolved
authors/apps/authentication/confirmation.py Outdated Show resolved Hide resolved
authors/apps/authentication/backends.py Show resolved Hide resolved
authors/apps/authentication/backends.py Show resolved Hide resolved
@fabzer0 fabzer0 added the work-in-progress For PR's that are as yet being worked on label Dec 6, 2018
@fabzer0 fabzer0 changed the title #161967010 verify user through the email address [WIP]#161967010 verify user through the email address Dec 6, 2018
@ghost ghost changed the title [WIP]#161967010 verify user through the email address [WIP]#161967010 Verify User Registration Through Email Address Dec 6, 2018
@ghost ghost changed the title [WIP]#161967010 Verify User Registration Through Email Address [WIP]#161967010 Verify User Registration Through Email Dec 6, 2018
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from e40f675 to 9e20483 Compare December 6, 2018 16:45
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 9e20483 to 272b078 Compare December 6, 2018 16:52
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 272b078 to 3925ee8 Compare December 6, 2018 17:31
authors/apps/authentication/views.py Show resolved Hide resolved
authors/apps/authentication/views.py Show resolved Hide resolved
authors/apps/authentication/views.py Show resolved Hide resolved
authors/apps/authentication/urls.py Outdated Show resolved Hide resolved
authors/apps/authentication/tests/test_registration.py Outdated Show resolved Hide resolved
authors/apps/authentication/backends.py Outdated Show resolved Hide resolved
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch 2 times, most recently from e42cfc4 to 236e048 Compare December 7, 2018 04:52
@fabzer0 fabzer0 changed the title [WIP]#161967010 Verify User Registration Through Email #161967010 Verify User Registration Through Email Dec 7, 2018
@fabzer0 fabzer0 removed the work-in-progress For PR's that are as yet being worked on label Dec 7, 2018
@mashafrancis
Copy link
Contributor

mashafrancis commented Dec 7, 2018

Nice work. A few missing instructions on the readme, to checkout to your branch, database configuration and the environment variables need to be added as well.
Then also add some docstrings to the methods you have created in the code and tests written.

@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch 2 times, most recently from d66fe28 to b3f4144 Compare December 7, 2018 07:04
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

This introduces changes that require re-writing of most of the other PR's. I would recommend that it be merged last.

@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch 2 times, most recently from 72950cf to 5f09e8b Compare December 7, 2018 08:07
@gwako94
Copy link
Contributor

gwako94 commented Dec 7, 2018

Kindly check on the tests

@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 5f09e8b to 32d7b16 Compare December 7, 2018 08:19
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 32d7b16 to 6fef8c8 Compare December 7, 2018 08:23
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 6fef8c8 to b2f6b06 Compare December 7, 2018 08:38
@fabzer0 fabzer0 changed the title #161967010 Verify User Registration Through Email #161967010 verify user registration through email Dec 7, 2018
@ghost ghost changed the title #161967010 verify user registration through email #161967010 Verify User Registration through Email Dec 7, 2018
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Tested this. Works great!

Copy link
Contributor

@mashafrancis mashafrancis left a comment

Choose a reason for hiding this comment

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

Awesome work.

@ghost ghost added the approved For PR's that have been reviewed and approved by >=3 peers label Dec 7, 2018
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from b2f6b06 to 712b220 Compare December 7, 2018 11:53
authors/apps/authentication/views.py Show resolved Hide resolved
authors/apps/authentication/views.py Outdated Show resolved Hide resolved
authors/apps/authentication/views.py Outdated Show resolved Hide resolved
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 712b220 to ac1a319 Compare December 7, 2018 12:00
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from ac1a319 to 4e42bdc Compare December 7, 2018 12:01
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch 3 times, most recently from d194c6d to e54e2fe Compare December 7, 2018 15:37
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from e1e5774 to 21a24a9 Compare December 8, 2018 10:06
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch 2 times, most recently from b37d0e8 to 3eb82ac Compare December 8, 2018 10:29
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 3eb82ac to 6019c84 Compare December 8, 2018 14:42
- set third party configs in the settings file
- add code in registration endpoint to send mail to the registered user
- create new activation endpoint that will activate the user
- write tests for the new and modified endpoints
[Delivers #161967010]
@fabzer0 fabzer0 force-pushed the ft-mail-verification-link-161967010 branch from 6019c84 to 0b9efe2 Compare December 8, 2018 14:46
@mirr254 mirr254 merged commit 451af4a into develop Dec 10, 2018
@ghost ghost deleted the ft-mail-verification-link-161967010 branch December 17, 2018 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved For PR's that have been reviewed and approved by >=3 peers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants