feat(provision): capitalize the stall owner name
Some checks failed
ci.yml / feat(provision): capitalize the stall owner name (pull_request) Failing after 0s

Before this commit, a username of "greg" produced the stall "greg's Store".
Now it produces "Greg's Store". The change is conservative:
`username[:1].upper() + username[1:]` preserves the existing case of
characters past the first (so "JohnDoe" stays "JohnDoe", not Python's
`.capitalize()` outcome "Johndoe").

Lives in `provision_merchant` so both callers — nostrmarket's lazy
`_auto_create_merchant` and the lnbits-side eager hook
(`_create_default_merchant` per aiolabs/lnbits#9) — benefit from a
single source of truth without each caller having to remember the
formatting convention.

Doesn't touch `merchant.config.display_name` (still defaults to None);
only the stall name string is affected.
This commit is contained in:
Padreug 2026-06-01 19:54:28 +02:00
commit c677e1bb7d

View file

@ -275,10 +275,11 @@ async def provision_merchant(
)
await create_zone(merchant.id, online_zone)
name = display_name or "My"
raw_owner_name = display_name or "My"
owner_name = raw_owner_name[:1].upper() + raw_owner_name[1:]
default_stall = Stall(
wallet=wallet_id,
name=f"{name}'s Store",
name=f"{owner_name}'s Store",
currency="sat",
shipping_zones=[online_zone],
)