mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
fix: POST /api/contacts/add crashes on JSON null name/email (None.strip()) (#1544)
This commit is contained in:
@@ -676,8 +676,8 @@ def setup_contacts_routes():
|
||||
@router.post("/add")
|
||||
async def add_contact(data: dict, _admin: str = Depends(require_admin)):
|
||||
"""Add a new contact."""
|
||||
name = data.get("name", "").strip()
|
||||
email = data.get("email", "").strip()
|
||||
name = (data.get("name") or "").strip()
|
||||
email = (data.get("email") or "").strip()
|
||||
if not email:
|
||||
return {"success": False, "error": "Email required"}
|
||||
# Check if already exists
|
||||
|
||||
Reference in New Issue
Block a user