Skip to content

Commit e12ec1b

Browse files
feat: added group_by_id field in notifications model (#35137)
1 parent 7ae80be commit e12ec1b

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

cms/envs/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2688,7 +2688,7 @@
26882688
############## NOTIFICATIONS EXPIRY ##############
26892689
NOTIFICATIONS_EXPIRY = 60
26902690
EXPIRED_NOTIFICATIONS_DELETE_BATCH_SIZE = 10000
2691-
NOTIFICATION_CREATION_BATCH_SIZE = 83
2691+
NOTIFICATION_CREATION_BATCH_SIZE = 76
26922692

26932693
############################ AI_TRANSLATIONS ##################################
26942694
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'

lms/envs/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5382,7 +5382,7 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
53825382
############## NOTIFICATIONS ##############
53835383
NOTIFICATIONS_EXPIRY = 60
53845384
EXPIRED_NOTIFICATIONS_DELETE_BATCH_SIZE = 10000
5385-
NOTIFICATION_CREATION_BATCH_SIZE = 83
5385+
NOTIFICATION_CREATION_BATCH_SIZE = 76
53865386
NOTIFICATIONS_DEFAULT_FROM_EMAIL = "[email protected]"
53875387
NOTIFICATION_TYPE_ICONS = {}
53885388
DEFAULT_NOTIFICATION_ICON_URL = ""
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.13 on 2024-07-23 07:59
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('notifications', '0005_notification_email_notification_web'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='notification',
15+
name='group_by_id',
16+
field=models.CharField(db_index=True, default='', max_length=42),
17+
),
18+
]

openedx/core/djangoapps/notifications/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class Notification(TimeStampedModel):
109109
email = models.BooleanField(default=False, null=False, blank=False)
110110
last_read = models.DateTimeField(null=True, blank=True)
111111
last_seen = models.DateTimeField(null=True, blank=True)
112+
group_by_id = models.CharField(max_length=42, db_index=True, null=False, default="")
112113

113114
def __str__(self):
114115
return f'{self.user.username} - {self.course_id} - {self.app_name} - {self.notification_type}'

0 commit comments

Comments
 (0)