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):
Ejemplo:
{
"file_hash": "1957db7fe23e4be1740ddeb941ddda7ae0a6b782e536a9e00b5aa82db1e84547",
"ots": "NzNkYzA5OGJkODlmZjdlMjc4OGFjMzJlNmU2ODdiOTdmODdiMTBjMWIyNzg5OTFlMDNkN2E2YWVkMDk3ODJkZTAxLTB4NGM2ZmNiNDBhMmUyZGVjYzc2YWQzMjM3MDU2NzZjMjljYWE1MmIyYjZkMDdiMDIzYjBhY2EzOWYzZGIxYmRlZg=="
"rd": "NzNkYzA5OGJkODlmZjdlMjc4OGFjMzJlNmU2ODdiOTdmODdiMTBjMWIyNzg5OTFlMDNkN2E2YWVkMDk3ODJkZTAxLTB4NGM2ZmNiNDBhMmUyZGVjYzc2YWQzMjM3MDU2NzZjMjljYWE1MmIyYjZkMDdiMDIzYjBhY2EzOWYzZGIxYmRlZg=="
}
"""
......@@ -87,6 +87,8 @@ class Verify(APIView):
def post(self, request):
try:
if not request.data.get('file_hash'):
raise ValidationError('file_hash')
......@@ -120,7 +122,8 @@ class Verify(APIView):
return Response({_('status'): _('success'),
_('permanent_ots'): base64.b64encode(permanent_ots.encode('utf-8')).decode('utf-8'),
_('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)
else:
return Response({_('status'): _('failure'), _('messages'): _('file_not_found')},
......@@ -140,7 +143,7 @@ class Verify(APIView):
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:
try:
transaction = TimestampManager.get_transaction(tx_hash)
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -22,12 +22,12 @@ msgid "Spanish"
msgstr ""
#: 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:152 app/views.py:155 app/views.py:157 app/views.py:160
#: app/views.py:122 app/views.py:128 app/views.py:145 app/views.py:150
#: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "status"
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"
msgstr ""
......@@ -35,45 +35,49 @@ msgstr ""
msgid "temporary_ots"
msgstr ""
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:126
#: app/views.py:152 app/views.py:155 app/views.py:157 app/views.py:160
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:128
#: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "failure"
msgstr ""
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:122
#: app/views.py:126 app/views.py:143 app/views.py:148 app/views.py:152
#: app/views.py:155 app/views.py:157 app/views.py:160
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:124
#: app/views.py:128 app/views.py:145 app/views.py:150 app/views.py:154
#: app/views.py:157 app/views.py:159 app/views.py:162
msgid "messages"
msgstr ""
#: app/views.py:50 app/views.py:155
#: app/views.py:50 app/views.py:157
msgid "parameter_missing"
msgstr ""
#: app/views.py:52 app/views.py:157
#: app/views.py:52 app/views.py:159
msgid "could_not_connect"
msgstr ""
#: app/views.py:55 app/views.py:160
#: app/views.py:55 app/views.py:162
msgid "operation_failed"
msgstr ""
#: app/views.py:121 app/views.py:143
#: app/views.py:123 app/views.py:145
msgid "permanent_ots"
msgstr ""
#: app/views.py:122 app/views.py:143
#: app/views.py:124 app/views.py:145
msgid "file_uploaded"
msgstr ""
#: app/views.py:126 app/views.py:152
#: app/views.py:128 app/views.py:154
msgid "file_not_found"
msgstr ""
#: app/views.py:148
#: app/views.py:145
msgid "attestation_time"
msgstr ""
#: app/views.py:150
msgid "pending"
msgstr ""
#: app/views.py:148
#: app/views.py:150
msgid "transaction_pending"
msgstr ""
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -23,12 +23,12 @@ msgid "Spanish"
msgstr ""
#: 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:152 app/views.py:155 app/views.py:157 app/views.py:160
#: app/views.py:122 app/views.py:128 app/views.py:145 app/views.py:150
#: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "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"
msgstr "success"
......@@ -36,46 +36,50 @@ msgstr "success"
msgid "temporary_ots"
msgstr "temporary_rd"
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:126
#: app/views.py:152 app/views.py:155 app/views.py:157 app/views.py:160
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:128
#: app/views.py:154 app/views.py:157 app/views.py:159 app/views.py:162
msgid "failure"
msgstr "failure"
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:122
#: app/views.py:126 app/views.py:143 app/views.py:148 app/views.py:152
#: app/views.py:155 app/views.py:157 app/views.py:160
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:124
#: app/views.py:128 app/views.py:145 app/views.py:150 app/views.py:154
#: app/views.py:157 app/views.py:159 app/views.py:162
msgid "messages"
msgstr "messages"
#: app/views.py:50 app/views.py:155
#: app/views.py:50 app/views.py:157
msgid "parameter_missing"
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"
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"
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"
msgstr "permanent_rd"
#: app/views.py:122 app/views.py:143
#: app/views.py:124 app/views.py:145
msgid "file_uploaded"
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"
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"
msgstr "pending"
#: app/views.py:148
#: app/views.py:150
msgid "transaction_pending"
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