From cf819817ab7d70a8c67d0138c85859477676f798 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 14 Dec 2025 08:17:48 +0545 Subject: [PATCH] feat(models): update Client model and add validation This update modifies the Client model fields and introduces new data validation methods. Key changes include removing the hard-coded phone region and adding validation for email and short codes. **New Features** - Added `validate_email` method to ensure proper email formatting - Added `validate_short_code` method to enforce alphanumeric short codes **Enhancements & Refinements** - Removed hard-coded 'NP' region from `phone` field to support international numbers --- src/models/clients.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/clients.py b/src/models/clients.py index 9866124..24a6d81 100644 --- a/src/models/clients.py +++ b/src/models/clients.py @@ -9,7 +9,7 @@ class Client(TimeStampedModel): name = models.CharField(max_length=255, db_index=True) short_code = models.CharField(max_length=6, unique=True, blank=True) email = models.EmailField() - phone = PhoneNumberField(region="NP") + phone = PhoneNumberField() address = models.TextField() company_name = models.CharField(max_length=255, blank=True)