0

So I have the following signal set up

    post_save.connect(self.increment_on,
                      sender=self.model_dict[self.model_involved],
                      dispatch_uid='increment_for' +
                                   self.model_involved + '_creation')

The signal works for the first 1-3 saves of the model and then stops running the function ( increment_on )

Is this normal? I am combing through the docs on signals and cant find it. post_save is wrapped in a function, should I call that function again? if so where?

Vincent Buscarello
  • 395
  • 2
  • 7
  • 19
  • From the source code ... > def disconnect(self, receiver=None, sender=None, weak=None, dispatch_uid=None): """ Disconnect receiver from sender for signal. If weak references are used, disconnect need not be called. The receiver will be remove from dispatch automatically. So now how to clear this..... – Vincent Buscarello Jul 26 '17 at 23:58

1 Answers1

0

For some reason I thought I read somewhere weak should not be set to false on the connect method, but everything works as expected when thats exactly what I do

    post_save.connect(self.increment_on,
                      sender=self.model_dict[self.model_involved],
                      dispatch_uid='increment_for' +
                                   self.model_involved + '_creation',
                      weak=False)
Vincent Buscarello
  • 395
  • 2
  • 7
  • 19