mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 16:40:36 +00:00
Removes unused related_book
field on notification model
This commit is contained in:
parent
300eea3b94
commit
8d266fda4d
3 changed files with 17 additions and 3 deletions
17
bookwyrm/migrations/0149_remove_notification_related_book.py
Normal file
17
bookwyrm/migrations/0149_remove_notification_related_book.py
Normal 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",
|
||||
),
|
||||
]
|
|
@ -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,
|
||||
|
|
|
@ -22,7 +22,6 @@ class Notifications(View):
|
|||
"related_import",
|
||||
"related_report",
|
||||
"related_user",
|
||||
"related_book",
|
||||
"related_list_item",
|
||||
"related_list_item__book",
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue