Skip to content

Commit

Permalink
events: discard notification if user has empty email (#8938)
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu authored Mar 18, 2024
1 parent d139549 commit 7783b20
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions authentik/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,13 @@ def send_webhook_slack(self, notification: "Notification") -> list[str]:

def send_email(self, notification: "Notification") -> list[str]:
"""Send notification via global email configuration"""
if notification.user.email.strip() == "":
LOGGER.info(
"Discarding notification as user has no email address",
user=notification.user,
notification=notification,
)
return None
subject_prefix = "authentik Notification: "
context = {
"key_value": {
Expand Down

0 comments on commit 7783b20

Please sign in to comment.