[Django]-Django.db.utils.NotSupportedError: FOR UPDATE cannot be applied to the nullable side of an outer join

0👍

I got this message because the the get_queryset() method has been overridden in the model manager. This method is also called by update_or_create.

def get_queryset(self):
    return super().get_queryset().annotations()

After getting rid of it, everything worked fine again. .annotations() was executing some group_by clause. That’s why update_or_create couldn’t proceed.

Leave a comment