2👍
I think because you are doing 2 wrong things,
1- You expect to have request on the model save method
2- You’re doing the (more or less) same things in two different save methods (form and model).
Now you’re doing something in the form save and then overriding that in the model save method.
My general suggestion is to drop with request and model save.
It’s better to do that kind of validation/checking things at form or view level IMHO.
- [Django]-Select default value of <select> element in Django
- [Django]-Django rest_framework 3.22 multiple updates creating objects instead of updating
- [Django]-How to filter generic foreign keys?
- [Django]-Django-Userena: adding extra non-null fields to a user's profile
Source:stackexchange.com