Django signal emitting once, received twice — Why?

后端 未结 2 866
名媛妹妹
名媛妹妹 2021-02-02 14:27

I\'m working with Django signals, but they seem to be received twice, even if emitted once. Here\'s the code I\'m working with (it\'s a simple wrapper to use Uploadify with Dja

2条回答
  •  粉色の甜心
    2021-02-02 14:47

    you can check "created" argument in your function that you are connecting with signal which returns True and False respectively.

    def task_feedback_status_handler(sender, instance, created, **kwargs):
    do something
    post_save.connect(task_feedback_status_handler, sender=Feedback)
    

提交回复
热议问题