Skip to content

Commit a461eef

Browse files
authored
Merge pull request #105 from virtualcell/fix/dedupe-biomodel-group-users
Dedupe repeated names in biomodel "Shared with" list
2 parents 506e1e2 + 95e4ebb commit a461eef

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎backend/app/services/vcelldb_service.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,15 @@ async def fetch_biomodels(
134134
# Extract biomodels list (assuming API returns a list directly)
135135
biomodels = raw_data if isinstance(raw_data, list) else raw_data.get("data", [])
136136

137+
# The legacy VCell API has a bug where, for a model shared with several
138+
# people, groupUsers repeats the caller's own name once per share instead
139+
# of listing the actual users it's shared with. Dedupe here so at least
140+
# we don't surface the repeated names to the frontend.
141+
for model in biomodels:
142+
group_users = model.get("groupUsers")
143+
if group_users:
144+
model["groupUsers"] = list(dict.fromkeys(group_users))
145+
137146
# Build response with metadata
138147
return {
139148
"search_params": params_dict,

0 commit comments

Comments
 (0)