Skip to content

Commit

Permalink
Add username in shared apps
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jan 8, 2024
1 parent 7a6718f commit 5112284
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jhub_apps/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ def get_all_shared_servers(hub_users, current_hub_user):
all_servers = []
for hub_user in hub_users:
if hub_user['name'] != current_hub_user['name']:
hub_user_servers = hub_user["servers"]
all_servers.extend(list(hub_user_servers.values()))
hub_user_servers = list(hub_user["servers"].values())
hub_user_servers_with_name = [{"username": hub_user['name'], **server} for server in hub_user_servers]
all_servers.extend(hub_user_servers_with_name)
# Filter default servers
return list(filter(lambda server: server['name'] != '', all_servers))

Expand Down

0 comments on commit 5112284

Please sign in to comment.