Changes between Initial Version and Version 1 of Ticket #28970


Ignore:
Timestamp:
Dec 28, 2017, 8:52:36 AM (7 years ago)
Author:
Tim Graham
Comment:

Resaving the object in post_save() doesn't sound like a common use case (or a wise thing to do, from a performance standpoint). Can you explain your use case?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28970 – Description

    initial v1  
    1 Calling instance.save() inside a post_save signal receiver causes a loop and max recursion error. This problem is very easy to fall into and the best solution at the moment is call the QuerySet update() method, so that the post_save signal is not called in this case.
     1Calling `instance.save()` inside a post_save signal receiver causes a loop and max recursion error. This problem is very easy to fall into and the best solution at the moment is call the `QuerySet update()` method, so that the post_save signal is not called in this case.
    22
    3 This is a very ugly workaround. I think Django should give the option to call save() and explicitly suppress signal emmiting. For example:
     3This is a very ugly workaround. I think Django should give the option to call `save()` and explicitly suppress signal emitting. For example:
    44
    5 instance.save(post_save=False)
     5`instance.save(post_save=False)`
    66
    77In the above method call, post_save signal would not be sent, and the loop problem would not occurs.
Back to Top