I have post_save signal set up so that every time a new object gets saved the signal is fired.

The problem is this signal is getting fired even when an existing object is updated. Im updating the object with save() as it says in the django docs but I dont want the signal to get fired when I update.

How do I go around this problem?

I tried to override the save() method like save(force_insert = False, force_update = True) but it dosent work.

有帮助吗?

解决方案

This doesn't keep the signal from firing, but you can check for kwargs['created'] inside your post_save signal handler

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top