Skip to content
Snippets Groups Projects
Commit da79b35e authored by Patricio Kumagae's avatar Patricio Kumagae
Browse files

Merge branch 'desarrollo'

parents 391665d0 68405830
No related branches found
No related tags found
No related merge requests found
...@@ -42,15 +42,15 @@ class Stamp(APIView): ...@@ -42,15 +42,15 @@ class Stamp(APIView):
proof = proof_hash + '-' + tx_hash.hex() 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: 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: 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: except Exception:
client.captureException() 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): class Verify(APIView):
...@@ -94,21 +94,21 @@ class Verify(APIView): ...@@ -94,21 +94,21 @@ class Verify(APIView):
block_number = TimestampManager.get_block_number(contract_version, proof_hash) block_number = TimestampManager.get_block_number(contract_version, proof_hash)
block = TimestampManager.get_block(block_number) 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: else:
try: try:
transaction = TimestampManager.get_transaction(tx_hash) transaction = TimestampManager.get_transaction(tx_hash)
if transaction and not transaction.blockNumber: 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: except ValueError:
pass 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: 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: 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: except Exception:
client.captureException() 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)
No preview for this file type
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -21,48 +21,55 @@ msgstr "" ...@@ -21,48 +21,55 @@ msgstr ""
msgid "Spanish" msgid "Spanish"
msgstr "" 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" msgid "success"
msgstr "" msgstr ""
#: app/views.py:57 #: app/views.py:45
msgid "proof" msgid "proof"
msgstr "" msgstr ""
#: app/views.py:60 app/views.py:63 app/views.py:130 app/views.py:133 #: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:106
#: app/views.py:135 app/views.py:138 #: app/views.py:109 app/views.py:111 app/views.py:114
msgid "failure" msgid "failure"
msgstr "" msgstr ""
#: app/views.py:60 app/views.py:63 app/views.py:118 app/views.py:128 #: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:97
#: app/views.py:130 app/views.py:133 app/views.py:135 app/views.py:138 #: app/views.py:102 app/views.py:106 app/views.py:109 app/views.py:111
#: app/views.py:114
msgid "messages" msgid "messages"
msgstr "" msgstr ""
#: app/views.py:60 app/views.py:133 #: app/views.py:48 app/views.py:109
msgid "parameter_missing" msgid "parameter_missing"
msgstr "" 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" msgid "operation_failed"
msgstr "" msgstr ""
#: app/views.py:118 #: app/views.py:97
msgid "file_uploaded" msgid "file_uploaded"
msgstr "" msgstr ""
#: app/views.py:128 #: app/views.py:102
msgid "pending" msgid "pending"
msgstr "" msgstr ""
#: app/views.py:128 #: app/views.py:102
msgid "transaction_pending" msgid "transaction_pending"
msgstr "" msgstr ""
#: app/views.py:130 #: app/views.py:106
msgid "file_not_found" msgid "file_not_found"
msgstr "" msgstr ""
#: app/views.py:135
msgid "could_not_connect"
msgstr ""
No preview for this file type
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -22,48 +22,55 @@ msgstr "" ...@@ -22,48 +22,55 @@ msgstr ""
msgid "Spanish" msgid "Spanish"
msgstr "" 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" msgid "success"
msgstr "success" msgstr "success"
#: app/views.py:57 #: app/views.py:45
msgid "proof" msgid "proof"
msgstr "proof" msgstr "proof"
#: app/views.py:60 app/views.py:63 app/views.py:130 app/views.py:133 #: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:106
#: app/views.py:135 app/views.py:138 #: app/views.py:109 app/views.py:111 app/views.py:114
msgid "failure" msgid "failure"
msgstr "failure" msgstr "failure"
#: app/views.py:60 app/views.py:63 app/views.py:118 app/views.py:128 #: app/views.py:48 app/views.py:50 app/views.py:53 app/views.py:97
#: app/views.py:130 app/views.py:133 app/views.py:135 app/views.py:138 #: app/views.py:102 app/views.py:106 app/views.py:109 app/views.py:111
#: app/views.py:114
msgid "messages" msgid "messages"
msgstr "messages" msgstr "messages"
#: app/views.py:60 app/views.py:133 #: app/views.py:48 app/views.py:109
msgid "parameter_missing" msgid "parameter_missing"
msgstr "Parámetro faltante: %s" 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" msgid "operation_failed"
msgstr "No se pudo realizar la operación" msgstr "No se pudo realizar la operación"
#: app/views.py:118 #: app/views.py:97
msgid "file_uploaded" msgid "file_uploaded"
msgstr "El archivo %s fue ingresado en el bloque %s el %s" msgstr "El archivo %s fue ingresado en el bloque %s el %s"
#: app/views.py:128 #: app/views.py:102
msgid "pending" msgid "pending"
msgstr "pending" msgstr "pending"
#: app/views.py:128 #: app/views.py:102
msgid "transaction_pending" msgid "transaction_pending"
msgstr "La transacción se encuentra pendiente de subida a la Blockchain" msgstr "La transacción se encuentra pendiente de subida a la Blockchain"
#: app/views.py:130 #: app/views.py:106
msgid "file_not_found" msgid "file_not_found"
msgstr "No se encontró el archivo" msgstr "No se encontró el archivo"
#: app/views.py:135
msgid "could_not_connect"
msgstr "No se pudo conectar a la Blockchain"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment