Fix: проверка self.object при создании заказа клиента (500)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,7 +50,7 @@ class CustomerOrderCreate(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
ctx["formset"] = CustomerOrderItemFormSet(instance=self.object) if self.object.pk else CustomerOrderItemFormSet()
|
||||
ctx["formset"] = CustomerOrderItemFormSet(instance=self.object) if self.object and self.object.pk else CustomerOrderItemFormSet()
|
||||
ctx["title"] = "Заказ клиента"
|
||||
return ctx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user