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

Fixed a bug where datasets within a public collection were not being filtered for excluded fields in get_entity_by_id #754

Merged
merged 1 commit into from
Oct 16, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def get_entity_by_id(id):
if public_entity and not user_in_hubmap_read_group(request):
final_result = schema_manager.exclude_properties_from_response(fields_to_exclude, final_result)
if normalized_entity_type == 'Collection':
for i, dataset in enumerate(final_result.get('datasets')):
for i, dataset in enumerate(final_result.get('datasets', [])):
if _get_entity_visibility(normalized_entity_type='Dataset', entity_dict=dataset) != DataVisibilityEnum.PUBLIC or user_in_hubmap_read_group(request):
# If the dataset is non-public, or if the user has read-group access, there is no need to remove fields, continue to the next dataset
continue
Expand Down
Loading