feat: added group_by_id field in notifications model (#35137)

This commit is contained in:
Muhammad Adeel Tajamul
2024-07-23 14:28:56 +05:00
committed by GitHub
parent 7ae80be815
commit e12ec1b153
4 changed files with 21 additions and 2 deletions

View File

@@ -2688,7 +2688,7 @@ EDXAPP_PARSE_KEYS = {}
############## NOTIFICATIONS EXPIRY ##############
NOTIFICATIONS_EXPIRY = 60
EXPIRED_NOTIFICATIONS_DELETE_BATCH_SIZE = 10000
NOTIFICATION_CREATION_BATCH_SIZE = 83
NOTIFICATION_CREATION_BATCH_SIZE = 76
############################ AI_TRANSLATIONS ##################################
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'

View File

@@ -5382,7 +5382,7 @@ SUBSCRIPTIONS_SERVICE_WORKER_USERNAME = 'subscriptions_worker'
############## NOTIFICATIONS ##############
NOTIFICATIONS_EXPIRY = 60
EXPIRED_NOTIFICATIONS_DELETE_BATCH_SIZE = 10000
NOTIFICATION_CREATION_BATCH_SIZE = 83
NOTIFICATION_CREATION_BATCH_SIZE = 76
NOTIFICATIONS_DEFAULT_FROM_EMAIL = "no-reply@example.com"
NOTIFICATION_TYPE_ICONS = {}
DEFAULT_NOTIFICATION_ICON_URL = ""

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.2.13 on 2024-07-23 07:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0005_notification_email_notification_web'),
]
operations = [
migrations.AddField(
model_name='notification',
name='group_by_id',
field=models.CharField(db_index=True, default='', max_length=42),
),
]

View File

@@ -109,6 +109,7 @@ class Notification(TimeStampedModel):
email = models.BooleanField(default=False, null=False, blank=False)
last_read = models.DateTimeField(null=True, blank=True)
last_seen = models.DateTimeField(null=True, blank=True)
group_by_id = models.CharField(max_length=42, db_index=True, null=False, default="")
def __str__(self):
return f'{self.user.username} - {self.course_id} - {self.app_name} - {self.notification_type}'