chore: satisfy upstream lint (black, mypy, prettier, ruff)
Some checks failed
lint.yml / chore: satisfy upstream lint (black, mypy, prettier, ruff) (push) Failing after 0s
Some checks failed
lint.yml / chore: satisfy upstream lint (black, mypy, prettier, ruff) (push) Failing after 0s
- black/prettier reformatting across new aio code - type annotations on db.fetchone/fetchall callsites in crud.py - explicit dict[str, list[str]] for tag_lists in nostr_sync.py - type:ignore[attr-defined] on Account.prvkey access — the field is added by the aio-fork lnbits.core.models.Account; upstream lnbits does not yet have it, so consumers without the fork must add a prvkey column to accounts before the Nostr publisher can sign. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
42a373bff1
commit
b428b0dca8
11 changed files with 48 additions and 57 deletions
21
views_api.py
21
views_api.py
|
|
@ -139,9 +139,7 @@ async def api_get_event(event_id: str) -> Event:
|
|||
|
||||
# closing_date is filled in by create_event (defaults to end_date or
|
||||
# start_date) but the field is typed Optional, so guard for the typechecker.
|
||||
closing_date = (
|
||||
event.closing_date or event.event_end_date or event.event_start_date
|
||||
)
|
||||
closing_date = event.closing_date or event.event_end_date or event.event_start_date
|
||||
is_window_open = datetime.now(timezone.utc) < datetime.strptime(
|
||||
closing_date, "%Y-%m-%d"
|
||||
).replace(tzinfo=timezone.utc)
|
||||
|
|
@ -181,10 +179,7 @@ async def api_event_create(
|
|||
|
||||
ext_settings = await get_settings()
|
||||
user_id = wallet.wallet.user
|
||||
is_admin = (
|
||||
user_id == settings.super_user
|
||||
or user_id in settings.lnbits_admin_users
|
||||
)
|
||||
is_admin = user_id == settings.super_user or user_id in settings.lnbits_admin_users
|
||||
if not is_admin and not ext_settings.auto_approve:
|
||||
data.status = "proposed"
|
||||
|
||||
|
|
@ -208,9 +203,7 @@ async def api_event_update(
|
|||
status_code=HTTPStatus.NOT_FOUND, detail="Event does not exist."
|
||||
)
|
||||
if event.wallet != wallet.wallet.id:
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.FORBIDDEN, detail="Not your event."
|
||||
)
|
||||
raise HTTPException(status_code=HTTPStatus.FORBIDDEN, detail="Not your event.")
|
||||
for k, v in data.dict().items():
|
||||
setattr(event, k, v)
|
||||
event = await update_event(event)
|
||||
|
|
@ -351,9 +344,7 @@ async def api_get_ticket(ticket_id: str) -> Ticket:
|
|||
|
||||
|
||||
@tickets_api_router.post("/{event_id}")
|
||||
async def api_ticket_create(
|
||||
event_id: str, data: CreateTicket
|
||||
) -> TicketPaymentRequest:
|
||||
async def api_ticket_create(event_id: str, data: CreateTicket) -> TicketPaymentRequest:
|
||||
event = await get_event(event_id)
|
||||
if not event:
|
||||
raise HTTPException(
|
||||
|
|
@ -423,9 +414,7 @@ async def _create_named_ticket(
|
|||
)
|
||||
|
||||
|
||||
async def _create_user_id_ticket(
|
||||
event: Event, user_id: str
|
||||
) -> TicketPaymentRequest:
|
||||
async def _create_user_id_ticket(event: Event, user_id: str) -> TicketPaymentRequest:
|
||||
price = event.price_per_ticket
|
||||
extra: dict[str, Any] = {"tag": "events", "user_id": user_id}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue