Skip to content

Commit

Permalink
Update max_length for phone numbers to adhere to ITU-T E.164 standard (
Browse files Browse the repository at this point in the history
…#2138)

* Update max_length for phone numbers to adhere to ITU-T E.164 standard

* Clean up an empty line

* Adds missing migrations

---------

Co-authored-by: rithviknishad <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>
  • Loading branch information
3 people authored May 12, 2024
1 parent 1cb7a29 commit ee2f148
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions care/facility/migrations/0430_alter_asset_support_phone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.8 on 2024-05-09 14:11

from django.db import migrations, models

import care.utils.models.validators


class Migration(migrations.Migration):
dependencies = [
("facility", "0429_double_pain_scale"),
]

operations = [
migrations.AlterField(
model_name="asset",
name="support_phone",
field=models.CharField(
default="",
max_length=15,
validators=[
care.utils.models.validators.PhoneNumberValidator(
types=("mobile", "landline", "support")
)
],
),
),
]
2 changes: 1 addition & 1 deletion care/facility/models/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Asset(BaseModel):
vendor_name = models.CharField(max_length=1024, blank=True, null=True)
support_name = models.CharField(max_length=1024, blank=True, null=True)
support_phone = models.CharField(
max_length=14,
max_length=15,
validators=[PhoneNumberValidator(types=("mobile", "landline", "support"))],
default="",
)
Expand Down

0 comments on commit ee2f148

Please sign in to comment.