Merge remote-tracking branch 'origin/main' into diagon-alley

This commit is contained in:
ben 2022-06-23 09:33:47 +01:00
commit b7fa4b8b05
5 changed files with 11 additions and 8 deletions

View file

@ -9,11 +9,6 @@ async def create_pay_link(data: CreatePayLinkData, wallet_id: str) -> PayLink:
returning = "" if db.type == SQLITE else "RETURNING ID" returning = "" if db.type == SQLITE else "RETURNING ID"
method = db.execute if db.type == SQLITE else db.fetchone method = db.execute if db.type == SQLITE else db.fetchone
# database only allows int4 entries for min and max. For fiat currencies,
# we multiply by data.fiat_base_multiplier (usually 100) to save the value in cents.
if data.currency and data.fiat_base_multiplier:
data.min *= data.fiat_base_multiplier
data.max *= data.fiat_base_multiplier
result = await (method)( result = await (method)(
f""" f"""

View file

@ -89,6 +89,12 @@ async def api_link_create_or_update(
detail="Must use full satoshis.", status_code=HTTPStatus.BAD_REQUEST detail="Must use full satoshis.", status_code=HTTPStatus.BAD_REQUEST
) )
# database only allows int4 entries for min and max. For fiat currencies,
# we multiply by data.fiat_base_multiplier (usually 100) to save the value in cents.
if data.currency and data.fiat_base_multiplier:
data.min *= data.fiat_base_multiplier
data.max *= data.fiat_base_multiplier
if "success_url" in data and data.success_url[:8] != "https://": if "success_url" in data and data.success_url[:8] != "https://":
raise HTTPException( raise HTTPException(
detail="Success URL must be secure https://...", detail="Success URL must be secure https://...",

View file

@ -38,7 +38,8 @@
<img height="30px" alt="Logo" src="{{ USE_CUSTOM_LOGO }}" /> <img height="30px" alt="Logo" src="{{ USE_CUSTOM_LOGO }}" />
{%else%} {% if SITE_TITLE != 'LNbits' %} {{ SITE_TITLE }} {% else {%else%} {% if SITE_TITLE != 'LNbits' %} {{ SITE_TITLE }} {% else
%} %}
<strong>LN</strong>bits {% endif %} {%endif%} {% endblock %} <span><strong>LN</strong>bits</span> {% endif %} {%endif%} {%
endblock %}
</q-btn> </q-btn>
</q-toolbar-title> </q-toolbar-title>
{% block beta %} {% block beta %}

View file

@ -8,6 +8,7 @@
{% if USE_CUSTOM_LOGO %} {% if USE_CUSTOM_LOGO %}
<img height="30px" alt="Logo" src="{{ USE_CUSTOM_LOGO }}" /> <img height="30px" alt="Logo" src="{{ USE_CUSTOM_LOGO }}" />
{%else%} {% if SITE_TITLE != 'LNbits' %} {{ SITE_TITLE }} {% else %} {%else%} {% if SITE_TITLE != 'LNbits' %} {{ SITE_TITLE }} {% else %}
<strong>LN</strong>bits {% endif %} {% endif %} <span><strong>LN</strong>bits</span>
{% endif %} {% endif %}
</a> </a>
{% endblock %} {% endblock %}

View file

@ -24,7 +24,7 @@ lnurl==0.3.6
markupsafe==2.0.1 markupsafe==2.0.1
marshmallow==3.13.0 marshmallow==3.13.0
outcome==1.1.0 outcome==1.1.0
psycopg2-binary==2.9.1 psycopg2==2.9.3
pycryptodomex==3.14.1 pycryptodomex==3.14.1
pydantic==1.8.2 pydantic==1.8.2
pypng==0.0.21 pypng==0.0.21