def form_valid(self, form): fc = FileControl() imgfile = form.cleaned_data["image"] file_id = fc.save(imgfile) self.success_url = reverse("confirm_registration_document", kwargs={"file_id": file_id}) return FormView.form_valid(self, form)