Skip to content

Commit

Permalink
Fix csv download for private or sensitive data (#4210)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimasciput committed Sep 2, 2024
1 parent c57ed90 commit 9588e5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bims/api_views/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def convert_to_geojson(self, queryset, Model, ModelSerializer):

def get(self, request):
filters = request.GET
search = CollectionSearch(filters)
search = CollectionSearch(filters, request.user.id if not request.user.is_anonymous else None)
file_type = request.GET.get('fileType', None)
if not file_type:
file_type = 'csv'
Expand Down
2 changes: 1 addition & 1 deletion bims/download/collection_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def write_batch_to_csv(header, rows, path_file, start_index):
download_request = get_download_request(download_request_id)

site_results = None
search = CollectionSearch(filters)
search = CollectionSearch(filters, user_id if user_id else None)
collection_results = search.process_search()
total_records = collection_results.count()

Expand Down

0 comments on commit 9588e5f

Please sign in to comment.