Skip to content

Commit

Permalink
Adds subject field to notificcation model
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort committed Aug 7, 2024
1 parent 0c4f0a0 commit d859a5d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 5.0.7 on 2024-08-07 17:47

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('notifications', '0002_alter_notification_notification_type'),
]

operations = [
migrations.AddField(
model_name='notification',
name='subject',
field=models.TextField(default=''),
preserve_default=False,
),
]
1 change: 1 addition & 0 deletions keystone_api/apps/notifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class NotificationType(models.TextChoices):

time = models.DateTimeField(auto_now_add=True)
read = models.BooleanField(default=False)
subject = models.TextField()
message = models.TextField()
metadata = models.JSONField(null=True)
notification_type = models.CharField(
Expand Down
1 change: 1 addition & 0 deletions keystone_api/apps/notifications/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def send_notification(

Notification.objects.create(
user=user,
subject=subject,
message=plain_text,
notification_type=notification_type,
metadata=notification_metadata
Expand Down

0 comments on commit d859a5d

Please sign in to comment.