Skip to content
Browse files

Add request object to signals

  • Loading branch information...
1 parent 72aed02 commit 87cdf5c9801f4509caabbab8eee34ca72b5ac935 @paltman paltman committed Dec 27, 2011
Showing with 5 additions and 4 deletions.
  1. +2 −2 phileo/signals.py
  2. +3 −2 phileo/views.py
View
4 phileo/signals.py
@@ -1,5 +1,5 @@
import django.dispatch
-object_liked = django.dispatch.Signal(providing_args=["like"])
-object_unliked = django.dispatch.Signal(providing_args=["object"])
+object_liked = django.dispatch.Signal(providing_args=["like", "request"])
+object_unliked = django.dispatch.Signal(providing_args=["object", "request"])
View
5 phileo/views.py
@@ -27,14 +27,15 @@ def like_toggle(request, content_type_id, object_id):
)
if created:
- object_liked.send(sender=Like, like=like)
+ object_liked.send(sender=Like, like=like, request=request)
else:
like.delete()
object_unliked.send(
sender=Like,
object=content_type.get_object_for_this_type(
pk=object_id
- )
+ ),
+ request=request
)
if request.is_ajax():

0 comments on commit 87cdf5c

Please sign in to comment.
Something went wrong with that request. Please try again.