Skip to content

Commit d275049

Browse files
[ENG-11791][ENG-11793] Update model to pre-calculate and sort recipients; rework campaign workflow (#11825)
* Refactor notification campaign logic: create recipients in batches, add run_id to models, and improve filtering by activity score * Update notification campaign logic * Update sendgrid bulk * Handle email sending errors in send_campaign_batch: log exceptions and update recipient statuses * Improve error logging --------- Co-authored-by: antkryt <ant.krytskyi@gmail.com>
1 parent 4fd95a0 commit d275049

4 files changed

Lines changed: 169 additions & 148 deletions

File tree

admin/notifications/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from mako.parsetree import ControlLine
1717
from string import Formatter
1818
from osf.email import _render_email_html
19-
from osf.email.notification_campaign import FILTER_PRESETS, filter_users
19+
from osf.email.notification_campaign import FILTER_PRESETS
2020

2121

2222
def delete_selected_notifications(selected_ids):
@@ -568,7 +568,7 @@ def get_queryset(self):
568568
else:
569569
filters[f'{item["field"]}__{item["lookup"]}'] = [value.strip() for value in item['value'].split(',')]
570570

571-
qs = filter_users(filters)
571+
qs = OSFUser.objects.filter(**filters)
572572
return qs.annotate(
573573
guid=F('guids___id')
574574
)

0 commit comments

Comments
 (0)