Skip to content

Commit

Permalink
Merge branch 'a285033184553995_asymmetric_encryption'
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Jul 7, 2017
2 parents 0bed851 + ea9520b commit a26573b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/source/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ containing additional information.

409
Document update conflict. The request could not be completed due to a conflict with the current state of the target resource. Please repeat your request.


410
Archived. The resource requested is not and will not be available.

412
Precondition Failed. See :ref:`API in cluster mode <cluster>`.

Expand Down
Binary file modified docs/source/locale/uk/LC_MESSAGES/errors.mo
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/source/locale/uk/LC_MESSAGES/errors.po
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,17 @@ msgstr ""
" JSON містить добре сформовані (тобто синтаксично правильні), але семантично"
" помилкові, інструкції у форматі JSON."

#: ../../source/errors.rst:43
msgid "410"
msgstr "410"

#: ../../source/errors.rst:41
msgid ""
"Archived. The resource requested is not and will not be available."
msgstr ""
"Архівовано. Шуканий ресурс не є й не буде доступним."

#: ../../source/errors.rst:49
msgid "429"
msgstr "429"

Expand Down
6 changes: 5 additions & 1 deletion src/openprocurement/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,11 @@ def context_unpack(request, msg, params=None):
def extract_tender_adapter(request, tender_id):
db = request.registry.db
doc = db.get(tender_id)
if doc is None or doc.get('doc_type') != 'Tender':
if doc is not None and doc.get('doc_type') == 'tender':
request.errors.add('url', 'tender_id', 'Archived')
request.errors.status = 410
raise error_handler(request.errors)
elif doc is None or doc.get('doc_type') != 'Tender':
request.errors.add('url', 'tender_id', 'Not Found')
request.errors.status = 404
raise error_handler(request.errors)
Expand Down

0 comments on commit a26573b

Please sign in to comment.