user3030969
user3030969

Reputation: 1575

Updating an object fires post_save signal

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.

Upvotes: 0

Views: 471

Answers (1)

dm03514
dm03514

Reputation: 55962

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

Upvotes: 2

Related Questions