diff --git a/api/app/views.py b/api/app/views.py index 93b32ec638638cf7cce586d7353f00a4fd0d46c7..9405799e7633323d971c9989e5416232cb57ce78 100644 --- a/api/app/views.py +++ b/api/app/views.py @@ -137,6 +137,7 @@ class Verify(APIView): permanent_ots = PERMANENT_OTS_PREFIX + '-' + file_hash + '-' + ots_hash + '-' + tx_hash + '-' + str(block_number) return Response({_('status'): _('success'), + _('from'): transaction['from'], _('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)))}, @@ -157,9 +158,16 @@ class Verify(APIView): block_number = TimestampManager.get_block_number(contract_version, ots_hash) block = TimestampManager.get_block(block_number) + transaction = TimestampManager.get_transaction(tx_hash) + permanent_ots = PERMANENT_OTS_PREFIX + '-' + 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') % (file_hash, str(block.number), str(Utils.datetime_from_timestamp(block.timestamp)))},status=status.HTTP_200_OK) + return Response({ + _('status'): _('success'), + _('from'): transaction['from'], + _('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))) + },status=status.HTTP_200_OK) else: try: transaction = TimestampManager.get_transaction(tx_hash)