Move notifications to signals

This commit is contained in:
Mouse Reeve
2021-09-22 09:17:14 -07:00
parent 2419942770
commit a4ac25bfae
6 changed files with 129 additions and 120 deletions

View File

@ -50,19 +50,6 @@ class ImportJob(models.Model):
)
retry = models.BooleanField(default=False)
def save(self, *args, **kwargs):
"""save and notify"""
super().save(*args, **kwargs)
if self.complete:
notification_model = apps.get_model(
"bookwyrm.Notification", require_ready=True
)
notification_model.objects.create(
user=self.user,
notification_type="IMPORT",
related_import=self,
)
class ImportItem(models.Model):
"""a single line of a csv being imported"""