1

So I am trying to post process the content of an object after it is saved.

@receiver(post_save, sender=Model)
def changed_model(instance, **kwargs):
    ...
    ...
    model.data = post_processed_data
    model.save()

And this leads to the function calling itself forever.

1 Answers1

0

So i found a few solutions that work:

  1. disconnect the signal before saving and connect again afterwards. https://stackoverflow.com/a/39483052/12087679

2.use update instead of save: https://stackoverflow.com/a/48512236/12087679