Skip to content

Commit

Permalink
Replace {u'message': u'EDRPOU not found'}] back
Browse files Browse the repository at this point in the history
  • Loading branch information
IrynaPomazan committed May 11, 2017
1 parent abb4827 commit ca39269
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openprocurement/integrations/edr/tests/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_invalid_code(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.status, '404 Not Found')
self.assertEqual(response.json['errors'][0]['description'],
[{u'error': {u'code': u'notFound', u'errorDetails': u"Couldn't find this code in EDR."},
[{u'message': u'EDRPOU not found',
u'meta': {u'sourceDate': u'2017-04-25T11:56:36+00:00'}}])

def test_unauthorized(self):
Expand Down
5 changes: 2 additions & 3 deletions openprocurement/integrations/edr/views/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ def verify_user(request):
data = response.json()
if not data:
LOGGER.warning('Accept empty response from EDR service for {}'.format(details.code))
return handle_error(request, [{u"error": {u"errorDetails": u"Couldn't find this code in EDR.",
u"code": u"notFound"},
u'meta': meta_data(response.headers['Date'])}], 404)
return handle_error(request, [{u'message': u'EDRPOU not found',
u'meta': meta_data(response.headers['Date'])}], 404)
LOGGER.info('Return data from EDR service for {}'.format(details.code))
return {'data': [prepare_data(d) for d in data], 'meta': meta_data(response.headers['Date'])}
elif response.status_code == 429:
Expand Down

0 comments on commit ca39269

Please sign in to comment.