Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Oct 29, 2024
1 parent 0206270 commit e0239a4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/masonite/notification/Notifiable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@


class Notifiable:
"""Notifiable mixin allowing to send notification to a model. It's often used with the
"""Notifiable mixin allowing to send
notification to a model. It's often used with the
User model.
Usage:
Expand All @@ -15,17 +16,18 @@ class Notifiable:
def notify(self, notification, drivers=[], dry=False, fail_silently=False):
"""Send the given notification."""
from wsgi import application

if hasattr(notification, "send"):
notification.send(notification, drivers, dry, fail_silently)

return application.make("notification").send(
self, notification, drivers, dry, fail_silently
)

def route_notification_for(self, driver):
"""Get the notification routing information for the given driver. If method has not been
defined on the model: for mail driver try to use 'email' field of model."""
"""Get the notification routing information for the given driver.
If method has not been defined on the model:
for mail driver try to use 'email' field of model."""
# check if routing has been specified on the model
method_name = "route_notification_for_{0}".format(driver)

Expand All @@ -41,7 +43,8 @@ def route_notification_for(self, driver):
return self.email
else:
raise NotificationException(
"Notifiable model does not implement {}".format(method_name)
"Notifiable model "
"does not implement {}".format(method_name)
)

@has_many("id", "notifiable_id")
Expand Down

0 comments on commit e0239a4

Please sign in to comment.