Skip to content

Commit

Permalink
Correções menores
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusandrade committed Sep 27, 2021
1 parent 40367c5 commit 5187af0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion bireme/api/events_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ def get_next(self, request, **kwargs):


r = requests.post(search_url, data=search_params)
try:
response_json = r.json()
except ValueError:
response_json = json.loads('{"type": "error", "message": "invalid output"}')

self.log_throttled_access(request)
return self.create_response(request, r.json())
return self.create_response(request, response_json)

def get_last_id(self, request, **kwargs):
self.method_check(request, allowed=['get'])
Expand Down
4 changes: 3 additions & 1 deletion bireme/templates/api_doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,6 @@ <h3>
<p>Ex.:</p>
<p><a href="{{request.scheme}}://{{request.get_host}}/api/qualif/thesaurus/?format=json&ths=1&decs_code=22004" rel="nofollow">{{request.scheme}}://{{request.get_host}}/api/qualif/thesaurus/?format=json&amp;ths=1&amp;decs_code=22004</a></p>
</div>
{% endblock %}
{% endblock %}

{% block lang_alert %}{% endblock %}
7 changes: 5 additions & 2 deletions bireme/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@
</script>
{% endblock %}

{% include "lang.html" %}
{% include "alert.html" %}
{% block lang_alert %}
{% include "lang.html" %}
{% include "alert.html" %}
{% endblock %}


{% block extrajs %}{% endblock %}

Expand Down
5 changes: 0 additions & 5 deletions bireme/utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,11 @@ def custom_page_not_found(request, *args, **argv):


def custom_error_page(request, *args, **argv):

error_type, error_value, tb = sys.exc_info()



response = render(request, '500.html', {'error_type': error_type,
'error_value': error_value,
'traceback': traceback.format_exception(error_type, error_value, tb)})



response.status_code = 500
return response

0 comments on commit 5187af0

Please sign in to comment.