From d3b434c407d52bff879f2b9e4125b74e1f30baea Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 26 Sep 2023 14:25:02 -0400 Subject: [PATCH] Fixes... --- lib/galaxy/managers/api_keys.py | 2 +- scripts/bootstrap_test_shed.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/managers/api_keys.py b/lib/galaxy/managers/api_keys.py index c43000b95c6c..89c8a39b8b18 100644 --- a/lib/galaxy/managers/api_keys.py +++ b/lib/galaxy/managers/api_keys.py @@ -11,7 +11,7 @@ class IsUserModel(Protocol): - id: str + id: int class ApiKeyManager: diff --git a/scripts/bootstrap_test_shed.py b/scripts/bootstrap_test_shed.py index c9ab2555cfe3..58c7c475b033 100644 --- a/scripts/bootstrap_test_shed.py +++ b/scripts/bootstrap_test_shed.py @@ -56,7 +56,7 @@ def main(argv: List[str]) -> None: {"name": "Invalid Test Tools", "description": "A contains a repository with invalid tools."} ) populator.setup_bismark_repo(category_id=category.id) - populator.setup_test_data_repo("0010", category_id=category.id) + populator.setup_test_data_repo("0010", category_id=category.id, assert_ok=False) category = populator.new_category_if_needed({"name": "Test Category", "description": "A longer test description."}) mirror_main_categories(populator) @@ -154,7 +154,7 @@ def new_category_if_needed(self, as_json: Dict[str, Any]) -> Category: return self.categories_by_name[name] return self.new_category(name, description) - def new_user_if_needed(self, as_json) -> Dict[str, Any]: + def new_user_if_needed(self, as_json: Dict[str, Any]) -> Dict[str, Any]: if "username" not in as_json: email = as_json["email"] as_json["username"] = email.split("@", 1)[0] @@ -164,7 +164,8 @@ def new_user_if_needed(self, as_json) -> Dict[str, Any]: if "email" not in as_json: mock_email = f"{username}@galaxyproject.org" as_json["email"] = mock_email - request = {"username": as_json["username"], "email": as_json["email"]} + request = {"username": username, "email": as_json["email"]} + print(f"creating user: {username}") user = create_user(self._admin_api_interactor, request) self.users_by_username[username] = user return user @@ -179,6 +180,7 @@ def mirror_main_categories(populator: RemoteToolShedPopulator): def mirror_main_users(populator: RemoteToolShedPopulator): main_users = get_main_users() for user in main_users: + assert isinstance(user, dict) populator.new_user_if_needed(user)