문제

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