Add phone_number field to UserProfile model - #23132
Conversation
|
Does this fall into the category of changes that AWS Aurora can do w/o locking up the table? |
|
@cpennington According to the Everything About Database Migrations doc, it shouldn't cause downtime: I've also let devops know this is coming. |
| allow_certificate = models.BooleanField(default=1) | ||
| bio = models.CharField(blank=True, null=True, max_length=3000, db_index=False) | ||
| profile_image_uploaded_at = models.DateTimeField(null=True, blank=True) | ||
| phone_regex = RegexValidator(regex=r'^\+?1?\d*$', message="Phone number can only contain numbers.") |
There was a problem hiding this comment.
Is it worth writing a unit test for this regex?
There was a problem hiding this comment.
Are we only allowing US based phone numbers?
There was a problem hiding this comment.
The plan is to allow for international numbers on the model, and do any additional filtering elsewhere.
| bio = models.CharField(blank=True, null=True, max_length=3000, db_index=False) | ||
| profile_image_uploaded_at = models.DateTimeField(null=True, blank=True) | ||
| phone_regex = RegexValidator(regex=r'^\+?1?\d*$', message="Phone number can only contain numbers.") | ||
| phone_number = models.CharField(validators=[phone_regex], blank=True, null=True, max_length=50) |
There was a problem hiding this comment.
I remember when we were going over OEP-38 in one of the Data Guild meetings, it said models should be annotated for PII. It looks like this does have the pii annotation, but do we have to add a new pii_type for "phone number"? OEP-38 points to OEP-30 here: https://github.com/edx/open-edx-proposals/blob/master/oeps/oep-0030-arch-pii-markup-and-auditing.rst.
There was a problem hiding this comment.
Added! Good catch.
Adds a simple nullable field to the UserProfile model. The only validation done it to make sure any character saved in that field is a digit and not a letter. We do not distiguish on a model level if the phone number is international or not.
1f05c85 to
d9af506
Compare
|
jenkins run a11y |
|
Your PR has finished running tests. There were no failures. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
MICROBA-184
Adds a simple nullable field to the UserProfile model. The only validation done it to make sure any character saved in that field is a digit and not a letter. We do not distiguish on a model level if the phone number is international or not.