feat(provision): capitalize the stall owner name
Some checks failed
ci.yml / feat(provision): capitalize the stall owner name (pull_request) Failing after 0s
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:
parent
c859b95521
commit
c677e1bb7d
1 changed files with 3 additions and 2 deletions
|
|
@ -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],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue