fix customer view and edit

This commit is contained in:
javad committed 2026-09-29 10:30:54 +03:30
1 parent 81335b1439
commit d5c22a39dc
13 files changed
+329 -81

No files matched your search

+16
View File
@@ -52,3 +52,19 @@ class CustomerProfile(PersianTextNormalizationMixin, TimeStampedModel):
province = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
def __str__(self): return (f"{self.first_name} {self.last_name}".strip() or self.user.mobile or self.user.username)
class ContactEditLog(models.Model):
"""Persistent record of changes made through the staff contact editor."""
contact = models.ForeignKey(CustomerProfile, on_delete=models.SET_NULL, null=True, related_name="edit_logs")
contact_public_id = models.UUIDField(db_index=True)
actor = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True, related_name="contact_edits")
actor_name = models.CharField(max_length=150)
changes = models.JSONField()
created_at = models.DateTimeField(auto_now_add=True, db_index=True)
class Meta:
ordering = ["-created_at", "-pk"]
verbose_name = "سابقه ویرایش مخاطب"
verbose_name_plural = "سوابق ویرایش مخاطبان"