Changes between Version 1 and Version 2 of Ticket #30835, comment 2


Ignore:
Timestamp:
Oct 4, 2019, 11:14:05 AM (5 years ago)
Author:
hibiscuits

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30835, comment 2

    v1 v2  
    33> The post_delete signal is explicitly sent within the same transaction as the actual deletion to ensure database changes performed in the receivers are tied to the transaction.
    44
    5 Ah.  I now understand why it is written the way it is.  But it is certainly not clear from the documentation that the {{{post_delete}}} signal is suitable only for other database activities and is unsuitable for things like sending a notification.  I do think that with a name like {{{post_delete}}}, it would be natural to assume that the deletion had actually been committed before sending the signal.  In fact, in the docs for {{{post_delete}}}, it explicitly says that the instance passed ''will not exist in the database'' at that point.  Perhaps there should be a {{{post_deletion_commit}}} signal.  The {{{on_commit}}} method you linked to looks like it would do the trick, but the whole appeal of a signal is that you don't have to write any logic in the place where the action is actually called.
     5Ah.  I now understand why it is written the way it is.  But it is certainly not clear from the documentation that the {{{post_delete}}} signal is suitable only for other database activities and is unsuitable for things like sending a notification.  I do think that with a name like {{{post_delete}}}, it would be natural to assume that the deletion had actually been committed before sending the signal.  In fact, in the docs for {{{post_delete}}}, it explicitly says that the instance passed ''will not exist in the database'' at that point.
    66
    77> Just to make sure I fully understand your report before closing this ticket, could you provide an example of your theory?
     
    1010
    1111 
    12 So, in summary, I understand your reasoning, but it seems there should be another signal at best, and a doc change at a minimum. By the way, I appreciate you not closing having closed this immediately.
     12So, in summary, I understand your reasoning, but I think there should be a doc change. By the way, I appreciate you not closing having closed this immediately.
Back to Top