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

Merge branch 'desarrollo'

parents 43263c72 c6548275
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ class Verify(APIView): ...@@ -70,7 +70,7 @@ class Verify(APIView):
Ejemplo: Ejemplo:
{ {
"file_hash": "1957db7fe23e4be1740ddeb941ddda7ae0a6b782e536a9e00b5aa82db1e84547", "file_hash": "1957db7fe23e4be1740ddeb941ddda7ae0a6b782e536a9e00b5aa82db1e84547",
"ots": "NzNkYzA5OGJkODlmZjdlMjc4OGFjMzJlNmU2ODdiOTdmODdiMTBjMWIyNzg5OTFlMDNkN2E2YWVkMDk3ODJkZTAxLTB4NGM2ZmNiNDBhMmUyZGVjYzc2YWQzMjM3MDU2NzZjMjljYWE1MmIyYjZkMDdiMDIzYjBhY2EzOWYzZGIxYmRlZg==" "rd": "NzNkYzA5OGJkODlmZjdlMjc4OGFjMzJlNmU2ODdiOTdmODdiMTBjMWIyNzg5OTFlMDNkN2E2YWVkMDk3ODJkZTAxLTB4NGM2ZmNiNDBhMmUyZGVjYzc2YWQzMjM3MDU2NzZjMjljYWE1MmIyYjZkMDdiMDIzYjBhY2EzOWYzZGIxYmRlZg=="
} }
""" """
...@@ -87,6 +87,8 @@ class Verify(APIView): ...@@ -87,6 +87,8 @@ class Verify(APIView):
def post(self, request): def post(self, request):
try: try:
if not request.data.get('file_hash'): if not request.data.get('file_hash'):
raise ValidationError('file_hash') raise ValidationError('file_hash')
...@@ -120,7 +122,8 @@ class Verify(APIView): ...@@ -120,7 +122,8 @@ class Verify(APIView):
return Response({_('status'): _('success'), return Response({_('status'): _('success'),
_('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8'), _('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8'),
_('messages'): _('file_uploaded') % ( _('messages'): _('file_uploaded') % (
file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))}, file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp))),
_('attestation_time'): str(Utils.datetime_from_timestamp(block.timestamp))},
status=status.HTTP_200_OK) status=status.HTTP_200_OK)
else: else:
return Response({_('status'): _('failure'), _('messages'): _('file_not_found')}, return Response({_('status'): _('failure'), _('messages'): _('file_not_found')},
...@@ -140,7 +143,7 @@ class Verify(APIView): ...@@ -140,7 +143,7 @@ class Verify(APIView):
permanent_ots = PERMANENT_OTS_PREFIX + '-' + original_file_hash + '-' + ots_hash + '-' + tx_hash + '-' + str(block_number) permanent_ots = PERMANENT_OTS_PREFIX + '-' + original_file_hash + '-' + ots_hash + '-' + tx_hash + '-' + str(block_number)
return Response({_('status'): _('success'), _('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8') ,_('messages'): _('file_uploaded') % (original_file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))},status=status.HTTP_200_OK) return Response({_('status'): _('success'), _('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8') , _('attestation_time'): str(Utils.datetime_from_timestamp(block.timestamp)),_('messages'): _('file_uploaded') % (original_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)
......
...@@ -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-09-11 17:30-0300\n" "POT-Creation-Date: 2018-09-20 11:13-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,12 +22,12 @@ msgid "Spanish" ...@@ -22,12 +22,12 @@ msgid "Spanish"
msgstr "" msgstr ""
#: app/views.py:47 app/views.py:50 app/views.py:52 app/views.py:55 #: app/views.py:47 app/views.py:50 app/views.py:52 app/views.py:55
#: app/views.py:120 app/views.py:126 app/views.py:143 app/views.py:148 #: app/views.py:122 app/views.py:128 app/views.py:145 app/views.py:150
#: app/views.py:152 app/views.py:155 app/views.py:157 app/views.py:160 #: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "status" msgid "status"
msgstr "" msgstr ""
#: app/views.py:47 app/views.py:120 app/views.py:143 #: app/views.py:47 app/views.py:122 app/views.py:145
msgid "success" msgid "success"
msgstr "" msgstr ""
...@@ -35,45 +35,49 @@ msgstr "" ...@@ -35,45 +35,49 @@ msgstr ""
msgid "temporary_ots" msgid "temporary_ots"
msgstr "" msgstr ""
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:126 #: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:128
#: app/views.py:152 app/views.py:155 app/views.py:157 app/views.py:160 #: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "failure" msgid "failure"
msgstr "" msgstr ""
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:122 #: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:124
#: app/views.py:126 app/views.py:143 app/views.py:148 app/views.py:152 #: app/views.py:128 app/views.py:145 app/views.py:150 app/views.py:154
#: app/views.py:155 app/views.py:157 app/views.py:160 #: app/views.py:157 app/views.py:159 app/views.py:162
msgid "messages" msgid "messages"
msgstr "" msgstr ""
#: app/views.py:50 app/views.py:155 #: app/views.py:50 app/views.py:157
msgid "parameter_missing" msgid "parameter_missing"
msgstr "" msgstr ""
#: app/views.py:52 app/views.py:157 #: app/views.py:52 app/views.py:159
msgid "could_not_connect" msgid "could_not_connect"
msgstr "" msgstr ""
#: app/views.py:55 app/views.py:160 #: app/views.py:55 app/views.py:162
msgid "operation_failed" msgid "operation_failed"
msgstr "" msgstr ""
#: app/views.py:121 app/views.py:143 #: app/views.py:123 app/views.py:145
msgid "permanent_ots" msgid "permanent_ots"
msgstr "" msgstr ""
#: app/views.py:122 app/views.py:143 #: app/views.py:124 app/views.py:145
msgid "file_uploaded" msgid "file_uploaded"
msgstr "" msgstr ""
#: app/views.py:126 app/views.py:152 #: app/views.py:128 app/views.py:154
msgid "file_not_found" msgid "file_not_found"
msgstr "" msgstr ""
#: app/views.py:148 #: app/views.py:145
msgid "attestation_time"
msgstr ""
#: app/views.py:150
msgid "pending" msgid "pending"
msgstr "" msgstr ""
#: app/views.py:148 #: app/views.py:150
msgid "transaction_pending" msgid "transaction_pending"
msgstr "" msgstr ""
...@@ -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-09-11 17:30-0300\n" "POT-Creation-Date: 2018-09-20 11:13-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"
...@@ -23,12 +23,12 @@ msgid "Spanish" ...@@ -23,12 +23,12 @@ msgid "Spanish"
msgstr "" msgstr ""
#: app/views.py:47 app/views.py:50 app/views.py:52 app/views.py:55 #: app/views.py:47 app/views.py:50 app/views.py:52 app/views.py:55
#: app/views.py:120 app/views.py:126 app/views.py:143 app/views.py:148 #: app/views.py:122 app/views.py:128 app/views.py:145 app/views.py:150
#: app/views.py:152 app/views.py:155 app/views.py:157 app/views.py:160 #: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "status" msgid "status"
msgstr "status" msgstr "status"
#: app/views.py:47 app/views.py:120 app/views.py:143 #: app/views.py:47 app/views.py:122 app/views.py:145
msgid "success" msgid "success"
msgstr "success" msgstr "success"
...@@ -36,46 +36,50 @@ msgstr "success" ...@@ -36,46 +36,50 @@ msgstr "success"
msgid "temporary_ots" msgid "temporary_ots"
msgstr "temporary_rd" msgstr "temporary_rd"
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:126 #: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:128
#: app/views.py:152 app/views.py:155 app/views.py:157 app/views.py:160 #: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "failure" msgid "failure"
msgstr "failure" msgstr "failure"
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:122 #: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:124
#: app/views.py:126 app/views.py:143 app/views.py:148 app/views.py:152 #: app/views.py:128 app/views.py:145 app/views.py:150 app/views.py:154
#: app/views.py:155 app/views.py:157 app/views.py:160 #: app/views.py:157 app/views.py:159 app/views.py:162
msgid "messages" msgid "messages"
msgstr "messages" msgstr "messages"
#: app/views.py:50 app/views.py:155 #: app/views.py:50 app/views.py:157
msgid "parameter_missing" msgid "parameter_missing"
msgstr "Parámetro faltante: %s" msgstr "Parámetro faltante: %s"
#: app/views.py:52 app/views.py:157 #: app/views.py:52 app/views.py:159
msgid "could_not_connect" msgid "could_not_connect"
msgstr "No se pudo conectar a la Blockchain" msgstr "No se pudo conectar a la Blockchain"
#: app/views.py:55 app/views.py:160 #: app/views.py:55 app/views.py:162
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:121 app/views.py:143 #: app/views.py:123 app/views.py:145
msgid "permanent_ots" msgid "permanent_ots"
msgstr "permanent_rd" msgstr "permanent_rd"
#: app/views.py:122 app/views.py:143 #: app/views.py:124 app/views.py:145
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:126 app/views.py:152 #: app/views.py:128 app/views.py:154
msgid "file_not_found" msgid "file_not_found"
msgstr "No se encontró el archivo" msgstr "No se encontró el archivo"
#: app/views.py:148 #: app/views.py:145
msgid "attestation_time"
msgstr "Attestation Time"
#: app/views.py:150
msgid "pending" msgid "pending"
msgstr "pending" msgstr "pending"
#: app/views.py:148 #: app/views.py:150
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"
......
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