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

Conversation

Projects
None yet
3 participants
@carlfeberhard
Copy link
Contributor

commented Jul 7, 2016

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

carlfeberhard added some commits Jul 6, 2016

API, users: add deserializer to user manager
- Adds deserialization method for usernames (note: still needs trans)
- Adds tests for deserializer in test_UserManager.py
API, users: implement users update
- 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

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Jul 8, 2016

Member

Please revert to include the dot (for Python3).

def _assertRaises_and_return_raised( self, exception_class, fn, *args, **kwargs ):
try:
fn( *args, **kwargs )
except exception_class, exception:

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Jul 8, 2016

Member

except exception_class as exception:

@nsoranzo

This comment has been minimized.

Copy link
Member

commented Jul 11, 2016

👍

@@ -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 ):

This comment has been minimized.

Copy link
@nsoranzo

nsoranzo Jul 11, 2016

Member

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

This comment has been minimized.

Copy link
@carlfeberhard

carlfeberhard Jul 18, 2016

Author Contributor

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

This comment has been minimized.

Copy link
@nsoranzo
@dannon

This comment has been minimized.

Copy link
Member

commented Jul 18, 2016

Looks good to me.

@dannon dannon merged commit e21a81f into galaxyproject:dev Jul 18, 2016

4 checks passed

api test Build finished. 223 tests run, 0 skipped, 0 failed.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
framework test Build finished. 110 tests run, 0 skipped, 0 failed.
Details
toolshed test Build finished. 582 tests run, 0 skipped, 0 failed.
Details

@carlfeberhard carlfeberhard deleted the carlfeberhard:users.api-update branch Aug 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.