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

[24.1] Fix typing issue in reused variable #18344

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/galaxy/webapps/galaxy/services/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ def get_index(
for key, value in user_dict.items():
if key in expose_keys:
limited_user[key] = value
user = LimitedUserModel(**limited_user)
rval.append(LimitedUserModel(**limited_user))
else:
user = UserModel(**user_dict)

rval.append(user)
rval.append(UserModel(**user_dict))
return rval
15 changes: 9 additions & 6 deletions test/integration/test_users.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
from typing import ClassVar
from typing import (
ClassVar,
Set,
)

from galaxy_test.driver import integration_util

USER_SUMMARY_KEYS = set(["model_class", "id", "email", "username", "deleted", "active", "last_password_change"])
USER_SUMMARY_KEYS: Set[str] = {"model_class", "id", "email", "username", "deleted", "active", "last_password_change"}


class UsersIntegrationCase(integration_util.IntegrationTestCase):
expose_user_name: ClassVar[bool]
expose_user_email: ClassVar[bool]
expected_regular_user_list_count: ClassVar[int]
expected_limited_user_keys: ClassVar[set]
expected_limited_user_keys: ClassVar[Set[str]]

@classmethod
def handle_galaxy_config_kwds(cls, config):
Expand Down Expand Up @@ -57,7 +60,7 @@ class TestExposeUsersIntegration(UsersIntegrationCase):
expose_user_email = True

# Since we allow to expose user information, all users are returned.
expected_limited_user_keys = set(["id", "username", "email"])
expected_limited_user_keys = {"id", "username", "email"}
expected_regular_user_list_count = 3


Expand All @@ -67,7 +70,7 @@ class TestExposeOnlyUserNameIntegration(UsersIntegrationCase):

# When only username is exposed, only that field is returned in the user list.
# Since we are exposing user information, all users are returned.
expected_limited_user_keys = set(["id", "username"])
expected_limited_user_keys = {"id", "username"}
expected_regular_user_list_count = 3


Expand All @@ -77,7 +80,7 @@ class TestExposeOnlyUserEmailIntegration(UsersIntegrationCase):

# When only email is exposed, only that field is returned in the user list.
# Since we are exposing user information, all users are returned.
expected_limited_user_keys = set(["id", "email"])
expected_limited_user_keys = {"id", "email"}
expected_regular_user_list_count = 3


Expand Down
Loading