adamspd / django-appointment

A Django app for managing appointment scheduling with ease and flexibility.
Apache License 2.0
89 stars 30 forks source link

appointment model: clean() and save() improvements #156

Closed deronnax closed 3 months ago

deronnax commented 3 months ago

Nit: all the checks in the save() should be removed, they are already done in clean() (except one but I can move it into clean). In Django, all checks are doneclean, and not in save. The way it's done is contrary to the django philosophy (yes theoretically a silly dev could call save with invalid data because he did not callclean()` but django is clear on it: that's his fault). If you are OK with this proposal, I will do this.

adamspd commented 3 months ago

@deronnax, you're right about everything said. I merged the pull request and the change wil be in the next release. Thanks a lot for that.

deronnax commented 3 months ago

Cool, thank you. Sorry, I did not notice I broke tests because they did not run on the MR. But I will know for next time.