Skip to content

Commit 159f904

Browse files
committed
Fix HTTP return code for 404 and 500 returns
1 parent 2ba320d commit 159f904

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

gmn/src/d1_gmn/app/views/internal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def error_404(request, exception):
8383
Note: Cannot raise NotFound() here, as this method is not covered by the GMN
8484
middleware handler that catches DataONE exceptions raised by normal views.
8585
"""
86-
return django.http.HttpResponse(
86+
return django.http.HttpResponseNotFound(
8787
d1_common.types.exceptions.NotFound(
8888
0,
8989
'Invalid API endpoint',
@@ -96,7 +96,7 @@ def error_404(request, exception):
9696

9797

9898
def error_500(request):
99-
return django.http.HttpResponse(
99+
return django.http.HttpResponseServerError(
100100
d1_common.types.exceptions.ServiceFailure(
101101
0,
102102
'Internal error',

lib_common/src/d1_common/tests/test_wrap_simple_xml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def test_1120(self):
152152
xml.replace_by_etree(new_replication_policy_el)
153153
assert len(xml.get_element_list_by_name('preferredMemberNode')) == 1
154154
assert len(xml.get_element_list_by_name('blockedMemberNode')) == 1
155-
assert xml.get_element('replicationPolicy').attrib['a'] == 'b'
156-
assert xml.get_element('replicationPolicy').attrib['c'] == 'd'
155+
assert xml.get_element_by_name('replicationPolicy').attrib['a'] == 'b'
156+
assert xml.get_element_by_name('replicationPolicy').attrib['c'] == 'd'
157157
d1_test.sample.assert_equals(xml.get_xml(), 'replace_by_etree')
158158

159159
def test_1130(self):

0 commit comments

Comments
 (0)