Skip to content

Commit

Permalink
Hook up phone number support
Browse files Browse the repository at this point in the history
  • Loading branch information
hmpf committed Aug 7, 2020
1 parent c561811 commit b8a4590
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/argus/notificationprofile/media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def send_notification(user: User, profile: NotificationProfile, incident: Incide
media = get_notification_media(profile.media)
for medium in media:
if medium is not None:
medium.send(incident, user)
medium.send(incident, user, phone_number=profile.phone_number)
else:
LOG.warn("Notification: Could not send notification, nowhere to send it to")

Expand Down
2 changes: 1 addition & 1 deletion src/argus/notificationprofile/media/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
class NotificationMedium(ABC):
@staticmethod
@abstractmethod
def send(incident: Incident, user: User):
def send(incident: Incident, user: User, **kwargs):
pass
2 changes: 1 addition & 1 deletion src/argus/notificationprofile/media/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def send_email_safely(function, additional_error=None, *args, **kwargs):

class EmailNotification(NotificationMedium):
@staticmethod
def send(incident, user):
def send(incident, user, **_):
if not user.email:
logging.getLogger("django.request").warning(
f"Cannot send email notification to user '{user}', as they have not set an email address."
Expand Down

0 comments on commit b8a4590

Please sign in to comment.