Skip to content

Commit

Permalink
[biblioref] Correções menores
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusandrade committed Oct 3, 2023
1 parent 89a4b85 commit c231d6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bireme/biblioref/search_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,18 @@ def prepare_related_research(self, obj):
# add related research
related_research_list = []
for related in related_research:
related_dict = {"_i": related.type.field, "_t": related.title, "_6": related.link, "_w": related.internal_id}
related_dict = {"_t": related.title, "_6": related.link, "_n": related.description}
related_dict_json = self.dict2json(related_dict)
related_research_list.append(related_dict_json)

return related_research_list

def dict2json(self, raw_dict):
clean_dict = {k: v for k, v in raw_dict.items() if v}
json_out = json.dumps(clean_dict, ensure_ascii=False).encode('utf8')

return json_out

def get_field_values(self, field, attribute = 'text'):
field_values = []
try:
Expand Down Expand Up @@ -472,7 +478,7 @@ def prepare_related_research(self, obj):
# add related research
related_research_list = []
for related in related_research:
related_dict = {"_i": related.type.field, "_t": related.title, "_6": related.link, "_w": related.internal_id}
related_dict = {"_t": related.title, "_6": related.link, "_n": related.description}
related_dict_json = self.dict2json(related_dict)
related_research_list.append(related_dict_json)

Expand Down
1 change: 0 additions & 1 deletion bireme/utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ def decs_suggestion(request):
text_by_lang[lang] = text_by_lang.get(lang, '') + ' ' + text['text']

service_url = settings.DECS_HIGHLIGHTER_URL
print(service_url)

headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
Expand Down

0 comments on commit c231d6f

Please sign in to comment.