diff --git a/app/services/RepairErpService.py b/app/services/RepairErpService.py index efaaaa1..8d8a84b 100644 --- a/app/services/RepairErpService.py +++ b/app/services/RepairErpService.py @@ -98,13 +98,12 @@ class RepairErpService: t.problem_description = t.issue_description t.priority = "NORMAL" if getattr(t, "customer", None): - name_parts = [t.customer.first_name, t.customer.last_name or ""] - t.customer_name = " ".join(p for p in name_parts if p).strip() or "Customer" - t.customer_phone = t.customer.phone or "" + t.customer_name = getattr(t.customer, "name", None) or getattr(t.customer, "first_name", "") or "Customer" + t.customer_phone = getattr(t.customer, "phone", "") or "" if getattr(t, "device", None): - t.brand_name = t.device.brand or "" - t.model_name = t.device.model_name or "" - t.imei_serial = t.device.imei_serial or "" + t.brand_name = getattr(t.device, "brand", "") or "" + t.model_name = getattr(t.device, "model_name", "") or "" + t.imei_serial = getattr(t.device, "imei_serial", "") or "" return t def get_ticket(self, ticket_id: str) -> Optional[CrmRepairTicket]: