diff --git a/lnbits/extensions/nostrnip5/crud.py b/lnbits/extensions/nostrnip5/crud.py index 12adc05a..fe71b981 100644 --- a/lnbits/extensions/nostrnip5/crud.py +++ b/lnbits/extensions/nostrnip5/crud.py @@ -173,12 +173,17 @@ async def create_address_internal(domain_id: str, data: CreateAddressData) -> Ad async def create_domain_internal(wallet_id: str, data: CreateDomainData) -> Domain: domain_id = urlsafe_short_hash() + if data.currency != "Satoshis": + amount = data.amount * 100 + else: + amount = data.amount + await db.execute( """ INSERT INTO nostrnip5.domains (id, wallet, currency, amount, domain) VALUES (?, ?, ?, ?, ?) """, - (domain_id, wallet_id, data.currency, int(data.amount * 100), data.domain), + (domain_id, wallet_id, data.currency, int(amount), data.domain), ) domain = await get_domain(domain_id) diff --git a/lnbits/extensions/nostrnip5/templates/nostrnip5/signup.html b/lnbits/extensions/nostrnip5/templates/nostrnip5/signup.html index c78639e0..15294817 100644 --- a/lnbits/extensions/nostrnip5/templates/nostrnip5/signup.html +++ b/lnbits/extensions/nostrnip5/templates/nostrnip5/signup.html @@ -36,12 +36,14 @@ context %} {% block page %} the {{ domain.domain }} domain.
- The current price is + The current price is {% if domain.currency != "Satoshis" %} {{ "{:0,.2f}".format(domain.amount / 100) }} {{ domain.currency }} - for an account (if you do not own the domain, the service provider can - disable at any time). + {% else %} + {{ "{}".format(domain.amount) }} {{ domain.currency }} + {% endif %} for an account (if you do not own the domain, the service + provider can disable at any time).
After submitting payment, your address will be