Skip to content
Advertisement

Django is_active field is not changing

I’m using django 4.0 when i change the is_active to False from django admin, it doesn’t make any changes to the object, I have override the save method in models.

models.py

JavaScript

admin.py

JavaScript

Can anyone advise ? The problem started when i added the save() in models.py

Advertisement

Answer

The .save() method should always call the super method, regardless whether pk is None or not, so:

JavaScript
Advertisement