Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

only emit signal when the flag is new

  • Loading branch information...
commit 545858d296bde646df826fbbcc0498d11e86819a 1 parent c323426
@brosner brosner authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 flag/models.py
View
11 flag/models.py
@@ -58,10 +58,11 @@ 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 = flag_instance,
- )
+ if created:
+ signals.content_flagged.send(
+ sender = FlaggedContent,
+ flagged_content = flagged_content,
+ flagged_instance = flag_instance,
+ )
return flag_instance
Please sign in to comment.
Something went wrong with that request. Please try again.