Skip to content

Commit

Permalink
No more ajax error when not logged in (facets still empty, though) (#…
Browse files Browse the repository at this point in the history
…1864)

* No more ajax error when not logged in (facets still empty, though)

* behavior changed. Test passes locally
  • Loading branch information
mccalluc committed Jul 6, 2017
1 parent 096f31e commit d407707
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions refinery/data_set_manager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,8 @@ def format_solr_response(solr_response):
facet_field_counts)
solr_response_json['facet_field_counts'] = facet_field_counts_obj
del solr_response_json['facet_counts']
else:
solr_response_json['facet_field_counts'] = {}

facet_field_docs = solr_response_json.get('response').get('docs')
facet_field_docs_count = solr_response_json.get('response').get('numFound')
Expand Down
3 changes: 2 additions & 1 deletion refinery/user_files_manager/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ def test_get(self):
force_authenticate(request, user=self.user)
response = self.view(request)
self.assertEqual(response.status_code, 200)
self.assertItemsEqual(response.data.keys(), [
self.assertItemsEqual(sorted(response.data.keys()), [
'attributes',
'facet_field_counts',
'nodes',
'nodes_count'
])
Expand Down

0 comments on commit d407707

Please sign in to comment.