Closes WikiDeck/wikideck#8
This commit is contained in:
parent
f1b3eab3a3
commit
20931ba41f
@ -246,8 +246,8 @@ class Database():
|
|||||||
cur.execute(self.SQL_GET_LAST_BLOCK)
|
cur.execute(self.SQL_GET_LAST_BLOCK)
|
||||||
blocks = cur.fetchall()
|
blocks = cur.fetchall()
|
||||||
if blocks:
|
if blocks:
|
||||||
blockCard = self.get_card_by_block_id(lastBlock[0])
|
blockCard = self.get_card_by_block_id(blocks[0])
|
||||||
blockTransactions = self.get_transactions_by_block_id(lastBlock[0])
|
blockTransactions = self.get_transactions_by_block_id(blocks[0])
|
||||||
return [
|
return [
|
||||||
Block(
|
Block(
|
||||||
blockId = uuid.UUID(block[0]),
|
blockId = uuid.UUID(block[0]),
|
||||||
|
|||||||
@ -171,6 +171,8 @@ def cards_get():
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
return flask.jsonify([card.as_dict() for card in deck] if deck else [])
|
return flask.jsonify([card.as_dict() for card in deck] if deck else [])
|
||||||
|
else:
|
||||||
|
return flask.jsonify({'Error': "No public key."}), 400
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return flask.jsonify(
|
return flask.jsonify(
|
||||||
{'Error': str(e)}
|
{'Error': str(e)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user