def form_valid(self, form): """If the form is valid, save the associated model.""" self.object = form.save() return super().form_valid(form)