-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect phonenumber to notificationprofile #104
Conversation
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
==========================================
+ Coverage 73.96% 74.15% +0.18%
==========================================
Files 34 34
Lines 1260 1327 +67
==========================================
+ Hits 932 984 +52
- Misses 328 343 +15
Continue to review full report at Codecov.
|
498550a
to
ba22adc
Compare
Checking that a user may change the phone number is done identically with how it's done for timeslots and filters. |
ba22adc
to
01c66c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments 🙂 Looks good otherwise! ✨
@@ -167,6 +167,7 @@ class Media(models.TextChoices): | |||
# TODO: support for multiple email addresses / phone numbers / Slack users | |||
media = MultiSelectField(choices=Media.choices, min_choices=1, default=Media.EMAIL) | |||
active = models.BooleanField(default=True) | |||
phone_number = models.ForeignKey("argus_auth.PhoneNumber", on_delete=models.SET_NULL, blank=True, null=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to
parameter to a reference, to be consistent with the other ForeignKey
fields?
phone_number = models.ForeignKey("argus_auth.PhoneNumber", on_delete=models.SET_NULL, blank=True, null=True) | |
phone_number = models.ForeignKey(to=PhoneNumber, on_delete=models.SET_NULL, blank=True, null=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'd rather get rid of "to", and use strings whenever we point to something in a different app. Lowers chance of import-loops, since the strings are IIRC lazily imported.
8f867cb
to
7aef582
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! 😄
7aef582
to
2da9cb5
Compare
Not done: validating that a phone number is owned by the notificationprofile's owner.