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

#162948989 Descriptive Registration validation errors #11

Merged
merged 1 commit into from
Jan 17, 2019

Conversation

Hesbon5600
Copy link
Contributor

@Hesbon5600 Hesbon5600 commented Jan 15, 2019

What does this PR do?

- Email must be valid and unique
- Password must be alphanumeric
- Password must have an uppercase and lowercase letter
- Password must be at least 8 characters long
- Username must be unique

How should this be manually tested?
prerequisites:

Have postgres installed and running on localhost.

Follow the following steps:

  1. Clone this repo with the following command:
    https://github.com/andela/ah-fulldeck.git

  2. Cd into the ah-fulldeck directory:
    cd ah-fulldeck

  3. Checkout to the branch ft-validate-signup-162948989 with the command:
    git checkout ft-validate-signup-162948989

  4. Install the requirements by running the command:
    pip install requirements.txt

  5. Create a database:
    create database fulldeck

  6. Export the environment settings as follows:
    export DATABASE="fulldeck"
    export USER="your postgres username "
    export HOST="localhost"
    export PASSWORD="your postgres password"

  7. Migrate the models to the db:
    python manage.py migrate

  8. Run the server:
    python manage.py runserver

  9. From postman:
    Create a user by sending a post request to the '/api/user/' end point with the data body
    {
    "user": {
    "username" :"prefered name",
    "email": "your email",
    "password": "password"
    }
    }
    You can change the format of the email or password.
    Invalid email and password will result in a response message outlinging the fault.
    An existing username or email will also throw an error message

Any background context you want to provide?
None

What are the relevant pivotal tracker stories?
#162948989

Screenshots

  1. Correct email and password format

screenshot 2019-01-15 at 15 45 16

2. Invalid email format

screenshot 2019-01-15 at 15 45 57

3. Password without a number or letter

screenshot 2019-01-16 at 10 37 34

@charitymarani charitymarani temporarily deployed to ah-fulldeck-staging-pr-11 January 15, 2019 12:53 Inactive
@eduhmik
Copy link
Contributor

eduhmik commented Jan 15, 2019

Hey @Hesbon5600 keep up the good spirit... however on your PR in the steps to follow when testing add an option to install virtualenv for the application and how to activate it on both OS

@charitymarani
Copy link
Contributor

The error messages are descriptive. Good work.

@Hesbon5600
Copy link
Contributor Author

Okay @edhmik I'll do that

@charitymarani charitymarani temporarily deployed to ah-fulldeck-staging-pr-11 January 16, 2019 15:10 Inactive
@charitymarani charitymarani temporarily deployed to ah-fulldeck-staging-pr-11 January 16, 2019 16:34 Inactive
min_length=8,
write_only=True
max_length=128,
Copy link
Contributor

Choose a reason for hiding this comment

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

@Hesbon5600 128 is alot, reset this to 30 max characters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay sure

# The username must be: unique, at least 5 characters long
# There should not be any space in the username
# Underscores and hyphens are also allowed in the username

Copy link
Contributor

Choose a reason for hiding this comment

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

at least 5? I thought in the implementation you used 8..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think It should just be '# The username must be: unique'. Let me fix that.
The password is the one that must be at least 8 characters

@charitymarani charitymarani temporarily deployed to ah-fulldeck-staging-pr-11 January 17, 2019 04:53 Inactive
@charitymarani charitymarani temporarily deployed to ah-fulldeck-staging-pr-11 January 17, 2019 07:27 Inactive
- Email must be valid and unique
- Password must be alphanumeric
- Password must have an uppercase and lowercase letter
- Password must be at least 8 characters long
- Username must be unique

[Delivers #162948989]
@kzyangiro kzyangiro merged commit 3e450d7 into develop Jan 17, 2019
@kzyangiro kzyangiro deleted the ft-validate-signup-162948989 branch January 17, 2019 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants