Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TsaAPI
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patricio Kumagae
TsaAPI
Commits
1457f2bb
Commit
1457f2bb
authored
6 years ago
by
Patricio Kumagae
Browse files
Options
Downloads
Plain Diff
Merge branch 'desarrollo'
parents
43263c72
c6548275
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/views.py
+6
-3
6 additions, 3 deletions
app/views.py
locale/en/LC_MESSAGES/django.po
+21
-17
21 additions, 17 deletions
locale/en/LC_MESSAGES/django.po
locale/es/LC_MESSAGES/django.po
+21
-17
21 additions, 17 deletions
locale/es/LC_MESSAGES/django.po
with
48 additions
and
37 deletions
app/views.py
+
6
−
3
View file @
1457f2bb
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
locale/en/LC_MESSAGES/django.po
+
21
−
17
View file @
1457f2bb
...
@@ -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:12
0
app/views.py:12
6
app/views.py:14
3
app/views.py:1
48
#: app/views.py:12
2
app/views.py:12
8
app/views.py:14
5
app/views.py:1
50
#: app/views.py:15
2 app/views.py:155
app/views.py:157 app/views.py:1
60
#: app/views.py:15
4
app/views.py:157 app/views.py:1
59 app/views.py:162
msgid "status"
msgid "status"
msgstr ""
msgstr ""
#: app/views.py:47 app/views.py:12
0
app/views.py:14
3
#: app/views.py:47 app/views.py:12
2
app/views.py:14
5
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:12
6
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:12
8
#: app/views.py:15
2 app/views.py:155
app/views.py:157 app/views.py:1
60
#: app/views.py:15
4
app/views.py:157 app/views.py:1
59 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:12
2
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:12
4
#: app/views.py:12
6
app/views.py:14
3
app/views.py:1
48
app/views.py:15
2
#: app/views.py:12
8
app/views.py:14
5
app/views.py:1
50
app/views.py:15
4
#: app/views.py:15
5
app/views.py:15
7
app/views.py:16
0
#: app/views.py:15
7
app/views.py:15
9
app/views.py:16
2
msgid "messages"
msgid "messages"
msgstr ""
msgstr ""
#: app/views.py:50 app/views.py:15
5
#: app/views.py:50 app/views.py:15
7
msgid "parameter_missing"
msgid "parameter_missing"
msgstr ""
msgstr ""
#: app/views.py:52 app/views.py:15
7
#: app/views.py:52 app/views.py:15
9
msgid "could_not_connect"
msgid "could_not_connect"
msgstr ""
msgstr ""
#: app/views.py:55 app/views.py:16
0
#: app/views.py:55 app/views.py:16
2
msgid "operation_failed"
msgid "operation_failed"
msgstr ""
msgstr ""
#: app/views.py:12
1
app/views.py:14
3
#: app/views.py:12
3
app/views.py:14
5
msgid "permanent_ots"
msgid "permanent_ots"
msgstr ""
msgstr ""
#: app/views.py:12
2
app/views.py:14
3
#: app/views.py:12
4
app/views.py:14
5
msgid "file_uploaded"
msgid "file_uploaded"
msgstr ""
msgstr ""
#: app/views.py:12
6
app/views.py:15
2
#: app/views.py:12
8
app/views.py:15
4
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:1
48
#: app/views.py:1
50
msgid "transaction_pending"
msgid "transaction_pending"
msgstr ""
msgstr ""
This diff is collapsed.
Click to expand it.
locale/es/LC_MESSAGES/django.po
+
21
−
17
View file @
1457f2bb
...
@@ -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:12
0
app/views.py:12
6
app/views.py:14
3
app/views.py:1
48
#: app/views.py:12
2
app/views.py:12
8
app/views.py:14
5
app/views.py:1
50
#: app/views.py:15
2 app/views.py:155
app/views.py:157 app/views.py:1
60
#: app/views.py:15
4
app/views.py:157 app/views.py:1
59 app/views.py:162
msgid "status"
msgid "status"
msgstr "status"
msgstr "status"
#: app/views.py:47 app/views.py:12
0
app/views.py:14
3
#: app/views.py:47 app/views.py:12
2
app/views.py:14
5
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:12
6
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:12
8
#: app/views.py:15
2 app/views.py:155
app/views.py:157 app/views.py:1
60
#: app/views.py:15
4
app/views.py:157 app/views.py:1
59 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:12
2
#: app/views.py:50 app/views.py:52 app/views.py:55 app/views.py:12
4
#: app/views.py:12
6
app/views.py:14
3
app/views.py:1
48
app/views.py:15
2
#: app/views.py:12
8
app/views.py:14
5
app/views.py:1
50
app/views.py:15
4
#: app/views.py:15
5
app/views.py:15
7
app/views.py:16
0
#: app/views.py:15
7
app/views.py:15
9
app/views.py:16
2
msgid "messages"
msgid "messages"
msgstr "messages"
msgstr "messages"
#: app/views.py:50 app/views.py:15
5
#: app/views.py:50 app/views.py:15
7
msgid "parameter_missing"
msgid "parameter_missing"
msgstr "Parámetro faltante: %s"
msgstr "Parámetro faltante: %s"
#: app/views.py:52 app/views.py:15
7
#: app/views.py:52 app/views.py:15
9
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:16
0
#: app/views.py:55 app/views.py:16
2
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:12
1
app/views.py:14
3
#: app/views.py:12
3
app/views.py:14
5
msgid "permanent_ots"
msgid "permanent_ots"
msgstr "permanent_rd"
msgstr "permanent_rd"
#: app/views.py:12
2
app/views.py:14
3
#: app/views.py:12
4
app/views.py:14
5
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:12
6
app/views.py:15
2
#: app/views.py:12
8
app/views.py:15
4
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:1
48
#: app/views.py:1
50
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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment