mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Python formatting
This commit is contained in:
parent
dc8e61f316
commit
b193652a67
2 changed files with 6 additions and 8 deletions
|
@ -8,13 +8,13 @@ import django.db.models.deletion
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bookwyrm', '0150_readthrough_stopped_date'),
|
||||
("bookwyrm", "0150_readthrough_stopped_date"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='notification',
|
||||
name='related_book',
|
||||
model_name="notification",
|
||||
name="related_book",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="notification",
|
||||
|
|
|
@ -39,10 +39,7 @@ class Notification(BookWyrmModel):
|
|||
"""Create a notification"""
|
||||
if not user.local or user == related_user:
|
||||
return
|
||||
notification, _ = cls.objects.get_or_create(
|
||||
user=user,
|
||||
**kwargs
|
||||
)
|
||||
notification, _ = cls.objects.get_or_create(user=user, **kwargs)
|
||||
notification.related_users.add(related_user)
|
||||
notification.unread = True
|
||||
notification.save()
|
||||
|
@ -92,7 +89,7 @@ def notify_on_unfav(sender, instance, *args, **kwargs):
|
|||
instance.status.user,
|
||||
instance.user,
|
||||
related_status=instance.status,
|
||||
notification_type="FAVORITE"
|
||||
notification_type="FAVORITE",
|
||||
)
|
||||
|
||||
|
||||
|
@ -195,5 +192,6 @@ def notify_admins_on_report(sender, instance, *args, **kwargs):
|
|||
notification, _ = Notification.objects.get_or_create(
|
||||
user=admin,
|
||||
notification_type="REPORT",
|
||||
unread=True,
|
||||
)
|
||||
notification.related_reports.add(instance)
|
||||
|
|
Loading…
Reference in a new issue