From 27b4db9877d22b8889d95cccb2097b1f5576c74e Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 25 Jul 2022 11:52:28 +0100 Subject: [PATCH 1/3] fix older tpos without tips (#778) --- lnbits/extensions/tpos/templates/tpos/tpos.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/tpos/templates/tpos/tpos.html b/lnbits/extensions/tpos/templates/tpos/tpos.html index cfda22c02..e11f60797 100644 --- a/lnbits/extensions/tpos/templates/tpos/tpos.html +++ b/lnbits/extensions/tpos/templates/tpos/tpos.html @@ -169,7 +169,9 @@
{% raw %}{{ fsat }} sat - ( + {{ tipAmountSat }} tip) + ( + {{ tipAmountSat }} tip) {% endraw %}
@@ -275,7 +277,7 @@ return { tposId: '{{ tpos.id }}', currency: '{{ tpos.currency }}', - tip_options: JSON.parse('{{ tpos.tip_options }}'), + tip_options: null, exchangeRate: null, stack: [], tipAmount: 0.0, @@ -352,7 +354,7 @@ this.showInvoice() }, submitForm: function () { - if (this.tip_options.length) { + if (this.tip_options) { this.showTipModal() } else { this.showInvoice() @@ -417,6 +419,11 @@ created: function () { var getRates = this.getRates getRates() + this.tip_options = + '{{ tpos.tip_options | tojson }}' == 'null' + ? null + : JSON.parse('{{ tpos.tip_options }}') + console.log(typeof this.tip_options, this.tip_options) setInterval(function () { getRates() }, 20000) From 210edde08af5ff7784f8fe2e8676898887eda537 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Mon, 25 Jul 2022 15:04:55 +0200 Subject: [PATCH 2/3] Migration: Fix withdraw (#780) --- tools/conv.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/conv.py b/tools/conv.py index 5821f7af8..99bb54f02 100644 --- a/tools/conv.py +++ b/tools/conv.py @@ -102,6 +102,8 @@ def insert_to_pg(query, data): print(e) print(f"Failed to insert {d}") else: + print("query:", query) + print("data:", d) raise ValueError(f"Failed to insert {d}") connection.commit() @@ -259,9 +261,10 @@ def migrate_ext(sqlite_db_file, schema, ignore_missing=True): open_time, used, usescsv, - webhook_url + webhook_url, + custom_url ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); + VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); """ insert_to_pg(q, res.fetchall()) # WITHDRAW HASH CHECK From 462fffbeaad2d668f3426c3862fc7900da08a834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 25 Jul 2022 15:08:30 +0200 Subject: [PATCH 3/3] .gitignore coverage.xml + do not delete mock_data.zip (#779) * add coverage.xml to gitignore * fix deleting mock_data.zip Co-authored-by: dni --- .gitignore | 1 + Makefile | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5b6199125..855e8737a 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ venv __bundle__ +coverage.xml node_modules lnbits/static/bundle.* docker diff --git a/Makefile b/Makefile index 5cc3f0509..2873ae774 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ mypy: $(shell find lnbits -name "*.py") ./venv/bin/mypy lnbits/core ./venv/bin/mypy lnbits/extensions/* -isort: $(shell find lnbits -name "*.py") +isort: $(shell find lnbits -name "*.py") ./venv/bin/isort --profile black lnbits checkprettier: $(shell find lnbits -name "*.js" -name ".html") @@ -36,7 +36,6 @@ requirements.txt: Pipfile.lock cat Pipfile.lock | jq -r '.default | map_values(.version) | to_entries | map("\(.key)\(.value)") | join("\n")' > requirements.txt test: - rm -rf ./tests/data mkdir -p ./tests/data LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \ FAKE_WALLET_SECRET="ToTheMoon1" \ @@ -45,14 +44,12 @@ test: ./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests test-real-wallet: - rm -rf ./tests/data mkdir -p ./tests/data LNBITS_DATA_FOLDER="./tests/data" \ PYTHONUNBUFFERED=1 \ - ./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests + ./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests test-pipenv: - rm -rf ./tests/data mkdir -p ./tests/data LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \ FAKE_WALLET_SECRET="ToTheMoon1" \