-
Notifications
You must be signed in to change notification settings - Fork 377
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
[FEATURE] remove random password generation when creating a user and password is not provided #4993
[FEATURE] remove random password generation when creating a user and password is not provided #4993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me just one extra test we could use.
@@ -35,6 +35,11 @@ def test_create_user(self, client: Argilla): | |||
assert user.id is not None | |||
assert client.users(username=user.username).id == user.id | |||
|
|||
def test_create_user_without_password(self, client: Argilla): | |||
user = User(username="test_user") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also test on retrieving an existing user via client.users("existing_user")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test with your suggestion. Please can you take a look to it?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat/v2.0.0 #4993 +/- ##
===============================================
- Coverage 60.92% 60.90% -0.02%
===============================================
Files 329 329
Lines 17674 17674
===============================================
- Hits 10767 10765 -2
- Misses 6907 6909 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
This PR remove the generation of a random password when a user is created a password is not provided.
With these changes when a user is created and no password is provided a
UnprocessableEntityError
will be raised from the backend showing that apassword
attribute must be provided.Closes #4933
Type of change
(Please delete options that are not relevant. Remember to title the PR according to the type of change)
How Has This Been Tested
(Please describe the tests that you ran to verify your changes. And ideally, reference
tests
)Checklist