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

Users API: add the update endpoint #2595

Merged
merged 8 commits into from
Jul 18, 2016
Merged

Users API: add the update endpoint #2595

merged 8 commits into from
Jul 18, 2016

Conversation

carlfeberhard
Copy link
Contributor

Implements update for the users API. Currently only username is deserialized but it should be easier to add more now.

  • tests for both the deserializer and the API endpoint were added
  • fixes some magic numbers and removes some TODOs

The user deserializer could be improved in the future by bypassing validate_user_input and removing the need to pass trans for the session.

Should close: #1992

- Adds deserialization method for usernames (note: still needs trans)
- Adds tests for deserializer in test_UserManager.py
- users and admin can now update usernames via the API
- adds api tests to update
from galaxy.managers import histories, users

from .base import BaseTestCase
from base import BaseTestCase
Copy link
Member

@nsoranzo nsoranzo Jul 8, 2016

Choose a reason for hiding this comment

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

Please revert to include the dot (for Python3).

@nsoranzo
Copy link
Member

👍

@@ -736,7 +736,7 @@ class ModelDeserializer( HasAModelManager ):
"""
# TODO:?? a larger question is: which should be first? Deserialize then validate - or - validate then deserialize?

def __init__( self, app, **kwargs ):
def __init__( self, app, validator=None, **kwargs ):
Copy link
Member

Choose a reason for hiding this comment

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

The new validator parameter does not seem to be used, is it for future functionalities?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Future composition:
https://github.com/galaxyproject/galaxy/pull/2595/files#diff-d9bd7857711700c7d77c35956699096dR306
Up to this point ModelValidator was enough.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @carlfeberhard!

@dannon
Copy link
Member

dannon commented Jul 18, 2016

Looks good to me.

@dannon dannon merged commit e21a81f into galaxyproject:dev Jul 18, 2016
@carlfeberhard carlfeberhard deleted the users.api-update branch August 2, 2016 12:14
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.

Add an update method to galaxy API, so the remote user name could be changed
3 participants