Permalink
Browse files

added content_flagged signal

  • Loading branch information...
1 parent 353b441 commit e3bdd8280513d56cd553fe6f821379f5aa462295 @brosner brosner committed May 7, 2010
Showing with 12 additions and 0 deletions.
  1. +8 −0 flag/models.py
  2. +4 −0 flag/signals.py
View
@@ -8,6 +8,8 @@
from django.contrib.contenttypes import generic
from django.utils.translation import ugettext_lazy as _
+from flag import signals
+
STATUS = getattr(settings, "FLAG_STATUSES", [
("1", _("flagged")),
@@ -56,4 +58,10 @@ def add_flag(flagger, content_type, object_id, content_creator, comment):
)
flag_instance.save()
+ signals.content_flagged.send(
+ sender = FlaggedContent,
+ flagged_content = flagged_content,
+ flagged_instance = flagged_instance,
+ )
+
return flag_instance
View
@@ -0,0 +1,4 @@
+from django.dispatch import Signal
+
+
+content_flagged = Signal(providing_args=["flagged_content", "flagged_instance"])

0 comments on commit e3bdd82

Please sign in to comment.