diff --git a/app/views.py b/app/views.py index adf3bbf88efa28bf2a0550ee7ed7965962238f0a..082678940439d5241f3882884f6ab26580926ad4 100644 --- a/app/views.py +++ b/app/views.py @@ -42,15 +42,15 @@ class Stamp(APIView): proof = proof_hash + '-' + tx_hash.hex() - return Response({'status': _('success'), _('proof'): base64.b64encode(proof.encode('utf-8')).decode('utf-8')}, status=status.HTTP_200_OK) + return Response({_('status'): _('success'), _('proof'): base64.b64encode(proof.encode('utf-8')).decode('utf-8')}, status=status.HTTP_200_OK) except ValidationError as e: - return Response({'status': _('failure'), _('messages'): _('parameter_missing') % e.message}, status=status.HTTP_400_BAD_REQUEST) + return Response({_('status'): _('failure'), _('messages'): _('parameter_missing') % e.message}, status=status.HTTP_400_BAD_REQUEST) except CannotHandleRequest: - return Response({'status': _('failure'), _('messages'): _('could_not_connect')}, status=status.HTTP_503_SERVICE_UNAVAILABLE) + return Response({_('status'): _('failure'), _('messages'): _('could_not_connect')}, status=status.HTTP_503_SERVICE_UNAVAILABLE) except Exception: client.captureException() - return Response({'status': _('failure'), _('messages'): _('operation_failed')}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + return Response({_('status'): _('failure'), _('messages'): _('operation_failed')}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) class Verify(APIView): @@ -94,21 +94,21 @@ class Verify(APIView): block_number = TimestampManager.get_block_number(contract_version, proof_hash) block = TimestampManager.get_block(block_number) - return Response({'status': _('success'),_('messages'): _('file_uploaded') % (file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))},status=status.HTTP_200_OK) + return Response({_('status'): _('success'),_('messages'): _('file_uploaded') % (file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))},status=status.HTTP_200_OK) else: try: transaction = TimestampManager.get_transaction(tx_hash) if transaction and not transaction.blockNumber: - return Response({'status': _('pending'), _('messages'): _('transaction_pending')}, status=status.HTTP_200_OK) + return Response({_('status'): _('pending'), _('messages'): _('transaction_pending')}, status=status.HTTP_200_OK) except ValueError: pass - return Response({'status': _('failure'), _('messages'): _('file_not_found')},status=status.HTTP_404_NOT_FOUND) + return Response({_('status'): _('failure'), _('messages'): _('file_not_found')},status=status.HTTP_404_NOT_FOUND) except ValidationError as e: - return Response({'status': _('failure'), _('messages'): _('parameter_missing') % e.message}, status=status.HTTP_400_BAD_REQUEST) + return Response({_('status'): _('failure'), _('messages'): _('parameter_missing') % e.message}, status=status.HTTP_400_BAD_REQUEST) except CannotHandleRequest: - return Response({'status': _('failure'), _('messages'): _('could_not_connect')}, status=status.HTTP_503_SERVICE_UNAVAILABLE) + return Response({_('status'): _('failure'), _('messages'): _('could_not_connect')}, status=status.HTTP_503_SERVICE_UNAVAILABLE) except Exception: client.captureException() - return Response({'status': _('failure'), _('messages'): _('operation_failed')}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) + return Response({_('status'): _('failure'), _('messages'): _('operation_failed')}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index b91ca57642cadccf54f8b73e23fdb97d681a571f..8b415ac83bfc32f7f78a7534def6465d14361eda 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 3ad451c05051bc935b79cb1720114370d360f311..4a09832953884a8c30a66d90d26a956699f30a2e 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-14 16:05-0300\n" +"POT-Creation-Date: 2018-08-16 15:14-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -21,48 +21,55 @@ msgstr "" msgid "Spanish" msgstr "" -#: app/views.py:57 app/views.py:118 +#: app/views.py:45 app/views.py:48 app/views.py:50 app/views.py:53 +#: app/views.py:97 app/views.py:102 app/views.py:106 app/views.py:109 +#: app/views.py:111 app/views.py:114 +msgid "status" +msgstr "" + +#: app/views.py:45 app/views.py:97 msgid "success" msgstr "" -#: app/views.py:57 +#: app/views.py:45 msgid "proof" msgstr "" -#: app/views.py:60 app/views.py:63 app/views.py:130 app/views.py:133 -#: app/views.py:135 app/views.py:138 +#: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:106 +#: app/views.py:109 app/views.py:111 app/views.py:114 msgid "failure" msgstr "" -#: app/views.py:60 app/views.py:63 app/views.py:118 app/views.py:128 -#: app/views.py:130 app/views.py:133 app/views.py:135 app/views.py:138 +#: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:97 +#: app/views.py:102 app/views.py:106 app/views.py:109 app/views.py:111 +#: app/views.py:114 msgid "messages" msgstr "" -#: app/views.py:60 app/views.py:133 +#: app/views.py:48 app/views.py:109 msgid "parameter_missing" msgstr "" -#: app/views.py:63 app/views.py:138 +#: app/views.py:50 app/views.py:111 +msgid "could_not_connect" +msgstr "" + +#: app/views.py:53 app/views.py:114 msgid "operation_failed" msgstr "" -#: app/views.py:118 +#: app/views.py:97 msgid "file_uploaded" msgstr "" -#: app/views.py:128 +#: app/views.py:102 msgid "pending" msgstr "" -#: app/views.py:128 +#: app/views.py:102 msgid "transaction_pending" msgstr "" -#: app/views.py:130 +#: app/views.py:106 msgid "file_not_found" msgstr "" - -#: app/views.py:135 -msgid "could_not_connect" -msgstr "" diff --git a/locale/es/LC_MESSAGES/django.mo b/locale/es/LC_MESSAGES/django.mo index 2319ba5a3408521f6c4f51186eb63661e9c1cd15..795cefe2fe9af8963b8cf239565d5344882d56f8 100644 Binary files a/locale/es/LC_MESSAGES/django.mo and b/locale/es/LC_MESSAGES/django.mo differ diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po index 7372335d6296ab8e82cfb25cc6c00080ae89aea7..de57c23969f7de85bc97a195621569b23d5f8389 100644 --- a/locale/es/LC_MESSAGES/django.po +++ b/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-08-14 16:05-0300\n" +"POT-Creation-Date: 2018-08-16 15:14-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -22,48 +22,55 @@ msgstr "" msgid "Spanish" msgstr "" -#: app/views.py:57 app/views.py:118 +#: app/views.py:45 app/views.py:48 app/views.py:50 app/views.py:53 +#: app/views.py:97 app/views.py:102 app/views.py:106 app/views.py:109 +#: app/views.py:111 app/views.py:114 +msgid "status" +msgstr "status" + +#: app/views.py:45 app/views.py:97 msgid "success" msgstr "success" -#: app/views.py:57 +#: app/views.py:45 msgid "proof" msgstr "proof" -#: app/views.py:60 app/views.py:63 app/views.py:130 app/views.py:133 -#: app/views.py:135 app/views.py:138 +#: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:106 +#: app/views.py:109 app/views.py:111 app/views.py:114 msgid "failure" msgstr "failure" -#: app/views.py:60 app/views.py:63 app/views.py:118 app/views.py:128 -#: app/views.py:130 app/views.py:133 app/views.py:135 app/views.py:138 +#: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:97 +#: app/views.py:102 app/views.py:106 app/views.py:109 app/views.py:111 +#: app/views.py:114 msgid "messages" msgstr "messages" -#: app/views.py:60 app/views.py:133 +#: app/views.py:48 app/views.py:109 msgid "parameter_missing" msgstr "Parámetro faltante: %s" -#: app/views.py:63 app/views.py:138 +#: app/views.py:50 app/views.py:111 +msgid "could_not_connect" +msgstr "No se pudo conectar a la Blockchain" + +#: app/views.py:53 app/views.py:114 msgid "operation_failed" msgstr "No se pudo realizar la operación" -#: app/views.py:118 +#: app/views.py:97 msgid "file_uploaded" msgstr "El archivo %s fue ingresado en el bloque %s el %s" -#: app/views.py:128 +#: app/views.py:102 msgid "pending" msgstr "pending" -#: app/views.py:128 +#: app/views.py:102 msgid "transaction_pending" msgstr "La transacción se encuentra pendiente de subida a la Blockchain" -#: app/views.py:130 +#: app/views.py:106 msgid "file_not_found" msgstr "No se encontró el archivo" - -#: app/views.py:135 -msgid "could_not_connect" -msgstr "No se pudo conectar a la Blockchain"