Skip to content

Commit

Permalink
Use SOLR_get instead of SOLR_select
Browse files Browse the repository at this point in the history
  • Loading branch information
amywieliczka committed Apr 18, 2024
1 parent 760a640 commit 42321a3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions exhibits/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from exhibits.md5s3stash import md5s3stash

try:
from calisphere.cache_retry import SOLR_select
from calisphere.cache_retry import SOLR_get
except ImportError:
from exhibits.cache_retry import SOLR_select
from exhibits.cache_retry import SOLR_get

RENDERING_OPTIONS = (
('H', 'HTML'),
Expand Down Expand Up @@ -64,9 +64,9 @@ def getRepositoryData(repository_data):

def get_reference_image_md5(item_id):
item_id_search_term = 'id:"{0}"'.format(item_id)
item_solr_search = SOLR_select(q=item_id_search_term)
if len(item_solr_search.results) > 0 and 'reference_image_md5' in item_solr_search.results[0]:
return item_solr_search.results[0]['reference_image_md5']
item_search = SOLR_get(q=item_id_search_term)
if item_search and 'reference_image_md5' in item_search.item:
return item_search.item['reference_image_md5']
else:
return None

Expand Down Expand Up @@ -535,9 +535,9 @@ def __str__(self):

def solrData(self):
item_id_search_term = 'id:"{0}"'.format(self.item_id)
item_solr_search = SOLR_select(q=item_id_search_term)
if len(item_solr_search.results) > 0:
item = item_solr_search.results[0]
item_search = SOLR_get(q=item_id_search_term)
if item_search:
item = item_search.item

item['parsed_collection_data'] = []
item['parsed_repository_data'] = []
Expand Down

0 comments on commit 42321a3

Please sign in to comment.