From d0375a990e07fed671bd47a6abd2e9b83ca6b905 Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Sat, 4 Jul 2026 01:42:11 +0000 Subject: [PATCH] =?UTF-8?q?A:=20Remove=20address=20fields=20from=20contact?= =?UTF-8?q?=5Fservice=20=E2=80=94=20dict,=20create,=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/contact_service.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app/services/contact_service.py b/app/services/contact_service.py index 80aef59..25c0559 100644 --- a/app/services/contact_service.py +++ b/app/services/contact_service.py @@ -14,9 +14,6 @@ from app.models.company import Company from app.models.contact import CompanyContact, Contact -ADDRESS_FIELDS = ("address_street", "address_city", "address_zip", "address_country", "address_state") - - def _contact_to_dict(c: Contact, include_companies: bool = False) -> dict[str, Any]: """Serialize a Contact ORM object to dict.""" data: dict[str, Any] = { @@ -30,11 +27,6 @@ def _contact_to_dict(c: Contact, include_companies: bool = False) -> dict[str, A "department": c.department, "linkedin_url": c.linkedin_url, "notes": c.notes, - "address_street": c.address_street, - "address_city": c.address_city, - "address_zip": c.address_zip, - "address_country": c.address_country, - "address_state": c.address_state, "created_at": c.created_at.isoformat() if c.created_at else None, "updated_at": c.updated_at.isoformat() if c.updated_at else None, } @@ -152,11 +144,6 @@ async def create_contact( department=data.get("department"), linkedin_url=data.get("linkedin_url"), notes=data.get("notes"), - address_street=data.get("address_street"), - address_city=data.get("address_city"), - address_zip=data.get("address_zip"), - address_country=data.get("address_country"), - address_state=data.get("address_state"), created_by=user_id, updated_by=user_id, ) @@ -227,7 +214,7 @@ async def update_contact( all_fields = ( "first_name", "last_name", "email", "phone", "mobile", "position", "department", "linkedin_url", "notes", - ) + ADDRESS_FIELDS + ) for field in all_fields: if field in data and data[field] is not None: old_val = getattr(contact, field)