Skip to content

Commit c32f7be

Browse files
committed
flake8 fix
1 parent 56f366c commit c32f7be

File tree

1 file changed

+10
-6
lines changed
  • baseapp-notifications/baseapp_notifications

1 file changed

+10
-6
lines changed

baseapp-notifications/baseapp_notifications/utils.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,16 @@ def send_email_notification(to, context):
121121

122122
def can_user_receive_notification(user_id, verb, channel):
123123
NotificationSetting = swapper.load_model("baseapp_notifications", "NotificationSetting")
124-
user_setting = NotificationSetting.objects.filter(
125-
Q(channel=channel) | Q(channel=NotificationSetting.NotificationChannelTypes.ALL),
126-
Q(verb=get_setting_from_verb(verb)) | Q(verb='_ALL_'),
127-
user_id=user_id,
128-
).order_by('is_active').first()
129-
124+
user_setting = (
125+
NotificationSetting.objects.filter(
126+
Q(channel=channel) | Q(channel=NotificationSetting.NotificationChannelTypes.ALL),
127+
Q(verb=get_setting_from_verb(verb)) | Q(verb="_ALL_"),
128+
user_id=user_id,
129+
)
130+
.order_by("is_active")
131+
.first()
132+
)
133+
130134
if user_setting:
131135
return user_setting.is_active
132136
return True

0 commit comments

Comments
 (0)