feat: event proposal and approval workflow #9
1 changed files with 8 additions and 1 deletions
fix: check auto_approve setting in propose endpoint
Some checks failed
lint.yml / fix: check auto_approve setting in propose endpoint (pull_request) Failing after 0s
Some checks failed
lint.yml / fix: check auto_approve setting in propose endpoint (pull_request) Failing after 0s
The propose endpoint always set status to 'proposed' regardless of the auto_approve setting. Now checks the setting and auto-approves (+ publishes to Nostr) when enabled. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commit
b4d7653988
|
|
@ -209,10 +209,17 @@ async def api_event_propose(
|
|||
"""
|
||||
Propose a new event for admin approval.
|
||||
Requires invoice key (any authenticated user, not admin-only).
|
||||
Auto-approved if the admin has enabled auto_approve in settings.
|
||||
"""
|
||||
data.status = "proposed"
|
||||
ext_settings = await get_settings()
|
||||
data.status = "approved" if ext_settings.auto_approve else "proposed"
|
||||
data.wallet = wallet.wallet.id
|
||||
event = await create_event(data)
|
||||
|
||||
# Publish to Nostr if auto-approved
|
||||
if event.status == "approved":
|
||||
await _publish_or_delete_nostr_event(event)
|
||||
|
||||
return event.dict()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue