def form_valid(self, form): if get_is_content_owner(self.request): widget = Widget.site_objects.get(pk=self.kwargs['widget_pk']) self.object = form.save(commit=False) self.object.widget = widget # TODO: remove it from here self.object.site = Site.objects.get_current() self.object.save() return HttpResponseRedirect(self.get_success_url()) return redirect('/')
def form_valid(self, form): if get_is_content_owner(self.request): self.object = form.save(commit=False) self.object.save() return HttpResponseRedirect(self.get_success_url()) return redirect('/')