-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor get_user_by_username, get_user_by_email; use across code base
- Loading branch information
Showing
10 changed files
with
42 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ | |
get, | ||
put, | ||
) | ||
from sqlalchemy import select | ||
|
||
from galaxy.managers.users import get_user_by_email | ||
from galaxy_test.driver import integration_util | ||
|
||
TEST_USER_EMAIL = "[email protected]" | ||
|
@@ -19,8 +19,8 @@ def test_user_theme(self): | |
user = self._setup_user(TEST_USER_EMAIL) | ||
url = self._api_url(f"users/{user['id']}/theme/test_theme", params=dict(key=self.master_api_key)) | ||
app = cast(Any, self._test_driver.app if self._test_driver else None) | ||
stmt = select(app.model.User).filter(app.model.User.email == user["email"]).limit(1) | ||
db_user = app.model.session.scalars(stmt).first() | ||
|
||
db_user = get_user_by_email(app.model.session, user["email"]) | ||
|
||
# create some initial data | ||
put(url) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ | |
get, | ||
put, | ||
) | ||
from sqlalchemy import select | ||
|
||
from galaxy.managers.users import get_user_by_email | ||
from galaxy_test.driver import integration_util | ||
|
||
TEST_USER_EMAIL = "[email protected]" | ||
|
@@ -133,5 +133,4 @@ def __url(self, action, user): | |
return self._api_url(f"users/{user['id']}/{action}", params=dict(key=self.master_api_key)) | ||
|
||
def _get_dbuser(self, app, user): | ||
stmt = select(app.model.User).filter(app.model.User.email == user["email"]).limit(1) | ||
return app.model.session.scalars(stmt).first() | ||
return get_user_by_email(app.model.session, user["email"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters