File tree 1 file changed +10
-6
lines changed
baseapp-notifications/baseapp_notifications
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -121,12 +121,16 @@ def send_email_notification(to, context):
121
121
122
122
def can_user_receive_notification (user_id , verb , channel ):
123
123
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
+
130
134
if user_setting :
131
135
return user_setting .is_active
132
136
return True
You can’t perform that action at this time.
0 commit comments