Boost notifications
This commit is contained in:
parent
6f748a6a24
commit
ac57db5375
3 changed files with 37 additions and 27 deletions
|
@ -7,7 +7,6 @@ from django.utils.decorators import method_decorator
|
|||
from django.views import View
|
||||
|
||||
from bookwyrm import models
|
||||
from bookwyrm.status import create_notification
|
||||
|
||||
|
||||
# pylint: disable= no-self-use
|
||||
|
@ -68,14 +67,6 @@ class Boost(View):
|
|||
privacy=status.privacy,
|
||||
user=request.user,
|
||||
)
|
||||
|
||||
if status.user.local:
|
||||
create_notification(
|
||||
status.user,
|
||||
'BOOST',
|
||||
related_user=request.user,
|
||||
related_status=status
|
||||
)
|
||||
return redirect(request.headers.get('Referer', '/'))
|
||||
|
||||
|
||||
|
@ -90,13 +81,4 @@ class Unboost(View):
|
|||
).first()
|
||||
|
||||
boost.delete()
|
||||
|
||||
# delete related notification
|
||||
if status.user.local:
|
||||
notification = models.Notification.objects.filter(
|
||||
user=status.user, related_user=request.user,
|
||||
related_status=status, notification_type='BOOST'
|
||||
).first()
|
||||
if notification:
|
||||
notification.delete()
|
||||
return redirect(request.headers.get('Referer', '/'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue