Skip to content

Commit

Permalink
Fixes...
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 27, 2023
1 parent bb45581 commit ec6d8fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/managers/api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class IsUserModel(Protocol):
id: str
id: int


class ApiKeyManager:
Expand Down
8 changes: 5 additions & 3 deletions scripts/bootstrap_test_shed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
Expand All @@ -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
Expand All @@ -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)


Expand Down

0 comments on commit ec6d8fd

Please sign in to comment.