Skip to content

Commit

Permalink
added content_flagged signal
Browse files Browse the repository at this point in the history
  • Loading branch information
brosner committed May 7, 2010
1 parent 353b441 commit e3bdd82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flag/models.py
Expand Up @@ -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")),
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions flag/signals.py
@@ -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.