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
This commit is contained in:
1 file changed
+1
-1
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user