Enforce recipient-bound single-use invites and fix issue card layout; clean release tooling
Magent CI/CD / verify (push) Successful in 10m31s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Skipped

This commit is contained in:
2026-09-07 19:59:51 +12:00
parent 13edcb8136
commit a3b5759708
19 changed files with 439 additions and 305 deletions
+14
View File
@@ -1919,6 +1919,20 @@ async def send_invite_email(payload: Dict[str, Any]) -> Dict[str, Any]:
message = _normalize_optional_text(payload.get("message"))
reason = _normalize_optional_text(payload.get("reason"))
if template_key == 'invited':
if not invite:
raise HTTPException(status_code=400, detail='Choose an invitation before sending it.')
if int(invite.get('use_count') or 0) > 0:
raise HTTPException(status_code=400, detail='This invitation has already been used. Create a new invitation.')
if invite.get('recipient_email') and normalize_delivery_email(invite['recipient_email']) != recipient_email:
raise HTTPException(status_code=400, detail='This invitation belongs to a different recipient. Create a new invitation.')
invite = update_signup_invite(
int(invite['id']), code=invite['code'], label=invite.get('label'),
description=invite.get('description'), profile_id=invite.get('profile_id'),
role=invite.get('role'), max_uses=1, enabled=bool(invite.get('enabled')),
expires_at=invite.get('expires_at'), recipient_email=recipient_email,
)
try:
result = await send_templated_email(
template_key,