Question

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.

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top