magnet-cl / django-project-template

A project template for Django in python 3
MIT License
14 stars 8 forks source link

BaseUpdateView title uses the object and not the BD model instance #105

Open diegobeckdorf opened 3 years ago

diegobeckdorf commented 3 years ago

When the model str method uses attributes that might be updated but fail on validations the update template breadcrumbs and title will show the object to_str using the user input that failed. The BaseUpdateView context title should be loaded using the DB saved instance or the object before assigning the form input attributes

acolazo commented 3 years ago

Probably a self.object.refresh_from_db() fixes the issue.