feat: Group ora staff notifications (#36440)

* feat: Group ora staff notifications

* fix: Revert default change for ora staff notifications

* fix: update edx-ora2 version
This commit is contained in:
Hassan Raza
2025-04-09 14:34:07 +05:00
committed by GitHub
parent 0120179531
commit 40c82c2ff4
6 changed files with 22 additions and 5 deletions

View File

@@ -201,8 +201,10 @@ COURSE_NOTIFICATION_TYPES = {
'push': False,
'email_cadence': EmailCadence.DAILY,
'non_editable': [],
'content_template': _('<{p}>You have a new open response submission awaiting for review for '
'content_template': _('<{p}>You have a new open response submission awaiting review for '
'<{strong}>{ora_name}</{strong}></{p}>'),
'grouped_content_template': _('<{p}>You have multiple submissions awaiting review for '
'<{strong}>{ora_name}</{strong}></{p}>'),
'content_context': {
'ora_name': 'Name of ORA in course',
},

View File

@@ -106,6 +106,21 @@ class NewPostGrouper(BaseNotificationGrouper):
}
@NotificationRegistry.register('ora_staff_notification')
class OraStaffGrouper(BaseNotificationGrouper):
"""
Grouper for new ora staff notifications.
"""
def group(self, new_notification, old_notification):
"""
Groups new ora staff notifications based on the xblock ID.
"""
content_context = old_notification.content_context
content_context.setdefault("grouped", True)
return content_context
def group_user_notifications(new_notification: Notification, old_notification: Notification):
"""
Groups user notification based on notification type and group_id

View File

@@ -828,7 +828,7 @@ openedx-mongodbproxy==0.2.2
# via -r requirements/edx/kernel.in
optimizely-sdk==5.2.0
# via -r requirements/edx/bundled.in
ora2==6.14.7
ora2==6.15.0
# via -r requirements/edx/bundled.in
packaging==24.2
# via

View File

@@ -1396,7 +1396,7 @@ optimizely-sdk==5.2.0
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
ora2==6.14.7
ora2==6.15.0
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt

View File

@@ -1000,7 +1000,7 @@ openedx-mongodbproxy==0.2.2
# via -r requirements/edx/base.txt
optimizely-sdk==5.2.0
# via -r requirements/edx/base.txt
ora2==6.14.7
ora2==6.15.0
# via -r requirements/edx/base.txt
packaging==24.2
# via

View File

@@ -1058,7 +1058,7 @@ openedx-mongodbproxy==0.2.2
# via -r requirements/edx/base.txt
optimizely-sdk==5.2.0
# via -r requirements/edx/base.txt
ora2==6.14.7
ora2==6.15.0
# via -r requirements/edx/base.txt
packaging==24.2
# via