Merge branch 'main' into matthewcroughan/nixify

This commit is contained in:
ben 2022-07-25 15:01:33 +01:00
commit 3ffcab2d4d
4 changed files with 18 additions and 10 deletions

1
.gitignore vendored
View file

@ -31,6 +31,7 @@ venv
__bundle__
coverage.xml
node_modules
lnbits/static/bundle.*
docker

View file

@ -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" \

View file

@ -169,7 +169,9 @@
<h5 class="q-mt-none">
{% raw %}{{ fsat }}
<small>sat</small>
<span style="font-size: 0.75rem">( + {{ tipAmountSat }} tip)</span>
<span v-show="tip_options" style="font-size: 0.75rem"
>( + {{ tipAmountSat }} tip)</span
>
{% endraw %}
</h5>
</div>
@ -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)

View file

@ -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