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

Fix multi-sites overview #4141

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
5 changes: 4 additions & 1 deletion bims/api_views/location_site_overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class LocationSiteOverviewData(object):
search_filters = None
is_sass_exist = False

search_process = None

def biodiversity_data(self):
if not self.search_filters:
return {}
Expand Down Expand Up @@ -175,7 +177,8 @@ def get(self, request):

search_process, created = get_or_create_search_process(
search_type=SITES_SUMMARY,
query=search_uri
query=search_uri,
requester=self.request.user
)
results = search_process.get_file_if_exits()
if results:
Expand Down
4 changes: 4 additions & 0 deletions bims/tasks/location_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def location_sites_overview(
search_process.set_status(SEARCH_PROCESSING)

overview_data = LocationSiteOverviewData()
if search_process.requester and 'requester' not in search_parameters:
search_parameters['requester'] = search_process.requester.id

overview_data.search_filters = search_parameters

results = dict()
results[LocationSiteOverviewData.BIODIVERSITY_DATA] = (
overview_data.biodiversity_data()
Expand Down