Removes unused related_book field on notification model

This commit is contained in:
Mouse Reeve 2022-04-08 15:21:06 -07:00
parent 300eea3b94
commit 8d266fda4d
3 changed files with 17 additions and 3 deletions

View file

@ -0,0 +1,17 @@
# Generated by Django 3.2.12 on 2022-04-08 22:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0148_alter_user_preferred_language"),
]
operations = [
migrations.RemoveField(
model_name="notification",
name="related_book",
),
]

View file

@ -15,7 +15,6 @@ class Notification(BookWyrmModel):
"""you've been tagged, liked, followed, etc"""
user = models.ForeignKey("User", on_delete=models.CASCADE)
related_book = models.ForeignKey("Edition", on_delete=models.CASCADE, null=True)
related_user = models.ForeignKey(
"User", on_delete=models.CASCADE, null=True, related_name="related_user"
)
@ -38,7 +37,6 @@ class Notification(BookWyrmModel):
# there's probably a better way to do this
if self.__class__.objects.filter(
user=self.user,
related_book=self.related_book,
related_user=self.related_user,
related_group=self.related_group,
related_status=self.related_status,

View file

@ -22,7 +22,6 @@ class Notifications(View):
"related_import",
"related_report",
"related_user",
"related_book",
"related_list_item",
"related_list_item__book",
)