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

Fix #1045: Remove incorrect password validation error #1129

Closed
wants to merge 0 commits into from
Closed

Fix #1045: Remove incorrect password validation error #1129

wants to merge 0 commits into from

Conversation

shailysangwan
Copy link
Contributor

@shailysangwan shailysangwan commented Feb 16, 2017

Proposed changes in this pull request

  • Modify email in password check and username in password check to check for email length and username length first. Only proceed with the checks if length is non zero

  • Fix Incorrect password validation error #1045

When should this PR be merged

  • First PR, I'm not sure of this

Risks

  • None foreseen

Follow up actions

  • Possibly update the test data to accommodate this incorrect validation error

Checklist (for reviewing)

General

  • Is this PR explained thoroughly? All code changes must be accounted for in the PR description.
  • Is the PR labeled correctly? It should have the migration label if a new migration is added.
  • Is the risk level assessment sufficient? The risks section should contain all risks that might be introduced with the PR and which actions we need to take to mitigate these risks. Possible risks are database migrations, new libraries that need to be installed or changes to deployment scripts.

Functionality

  • Are all requirements met? Compare implemented functionality with the requirements specification.
  • Does the UI work as expected? There should be no Javascript errors in the console; all resources should load. There should be no unexpected errors. Deliberately try to break the feature to find out if there are corner cases that are not handled.

Code

  • Do you fully understand the introduced changes to the code? If not ask for clarification, it might uncover ways to solve a problem in a more elegant and efficient way.
  • Does the PR introduce any inefficient database requests? Use the debug server to check for duplicate requests.
  • Are all necessary strings marked for translation? All strings that are exposed to users via the UI must be marked for translation.

Tests

  • Are there sufficient test cases? Ensure that all components are tested individually; models, forms, and serializers should be tested in isolation even if a test for a view covers these components.
  • If this is a bug fix, are tests for the issue in place There must be a test case for the bug to ensure the issue won’t regress. Make sure that the tests break without the new code to fix the issue.
  • If this is a new feature or a significant change to an existing feature has the manual testing spreadsheet been updated with instructions for manual testing?

Documentation

  • Are changes to the UI documented in the platform docs? If this PR introduces new platform site functionality or changes existing ones, the changes must be documented in the Cadasta Platform Documentation.
  • Are changes to the API documented in the API docs? If this PR introduces new API functionality or changes existing ones, the changes must be documented in the API docs.
  • Are reusable components documented? If this PR introduces components that are relevant to other developers (for instance a mixin for a view or a generic form) they should be documented in the Wiki.

@CLAassistant
Copy link

CLAassistant commented Feb 16, 2017

CLA assistant check
All committers have signed the CLA.

@shailysangwan
Copy link
Contributor Author

shailysangwan commented Feb 16, 2017

I tried running the tests (to add more for this possible test case), but I ran into the following error:

(env)vagrant@vagrant-ubuntu-trusty-64:/vagrant/cadasta/accounts/tests$ python test_forms.py 
Traceback (most recent call last):
  File "test_forms.py", line 7, in <module>
    from django.contrib.messages.storage.fallback import FallbackStorage
  File "/opt/cadasta/env/lib/python3.5/site-packages/django/contrib/messages/storage/fallback.py", line 1, in <module>
    from django.contrib.messages.storage.base import BaseStorage
  File "/opt/cadasta/env/lib/python3.5/site-packages/django/contrib/messages/storage/base.py", line 7, in <module>
    LEVEL_TAGS = utils.get_level_tags()
  File "/opt/cadasta/env/lib/python3.5/site-packages/django/contrib/messages/utils.py", line 10, in get_level_tags
    level_tags.update(getattr(settings, 'MESSAGE_TAGS', {}))
  File "/opt/cadasta/env/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/opt/cadasta/env/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/opt/cadasta/env/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/opt/cadasta/env/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named 'config'

@wonderchook
Copy link
Contributor

@shailysangwan are you meaning for this to be a pull request? If so please fill out the questions asked. If you don't know the answer you can say that.

@shailysangwan
Copy link
Contributor Author

shailysangwan commented Feb 16, 2017

I don't quite understand what the checks in serializers.py are for, so I've made two separate commits for both the files for now.
Can you help me understand?

Also, do I have to fill in the Checklist (for reviewing) section too?

@wonderchook
Copy link
Contributor

Can you come into gitter and I will see what i can do? https://gitter.im/Cadasta/cadasta

@shailysangwan shailysangwan changed the title Remove incorrect password validation error Fix #1045: Remove incorrect password validation error Feb 16, 2017
@manoramahp
Copy link
Contributor

@oliverroick I believe what is mentioned in this comment #675 (comment) is applicable to this PR as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect password validation error
6 participants