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

Updated checks for validate_name() in MemberForm() #1106

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mzhongqi
Copy link

The database allows users to deactivate an account with a non-zero value, and create a new user with the same name, reactivating the previous user will allow two users of the same name. This change assures that new user names can not be the same as deactivated users with associated bills (Users that are not deleted from deactivation).

@almet
Copy link
Member

almet commented Dec 11, 2022

Thanks for this, it seems good to me, but lacks a test to ensure that what you're doing works the way you intend. Are you okay to write such a test? Thanks!

@mzhongqi
Copy link
Author

Thanks for this, it seems good to me, but lacks a test to ensure that what you're doing works the way you intend. Are you okay to write such a test? Thanks!

@mzhongqi mzhongqi closed this Dec 11, 2022
@mzhongqi mzhongqi reopened this Dec 11, 2022
@almet
Copy link
Member

almet commented Dec 11, 2022

Probably a manipulation error?

@mzhongqi mzhongqi mentioned this pull request Dec 11, 2022
@mzhongqi
Copy link
Author

Probably a manipulation error?

Yes that was a manipulation error, sorry! I have just added two tests for this particular change at #1111.

mzhongqi and others added 3 commits February 3, 2023 20:49
The database allows users to deactivate an account with a non-zero value, and create a new user with the same name, reactivating the previous user will allow two users of the same name. This change assures that new user names can not be the same as deactivated users with associated bills (Users that are not deleted from deactivation).
Added 2 tests checking for validate_name() in MemberForm()
@zorun
Copy link
Collaborator

zorun commented Feb 3, 2023

Thanks for the patch, I added your new tests from #1111 so that we have everything in one place.

Two tests are failing:

  • your new test test_add_duplicate_user: the last call should be a POST, not a GET
  • the existing test test_membership: I believe this test is wrong, it uses /<project_id>/members/add to reactivate the user, but it should use /<project_id>/members/<member_id>/reactivate instead

@mzhongqi can you fix both tests?

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.

None yet

3 participants