update
This commit is contained in:
parent
1dd4780085
commit
9cd5c454d2
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -298,22 +298,22 @@ class CarRegistrationForm(forms.ModelForm):
|
|||||||
fields = ["car", "plate_number", "text1", "text2", "text3", "registration_date"]
|
fields = ["car", "plate_number", "text1", "text2", "text3", "registration_date"]
|
||||||
|
|
||||||
|
|
||||||
class VendorForm(VendorModelForm):
|
# class VendorForm(VendorModelForm):
|
||||||
pass
|
# pass
|
||||||
# class VendorForm(forms.ModelForm):
|
class VendorForm(forms.ModelForm):
|
||||||
# class Meta:
|
class Meta:
|
||||||
# model = Vendor
|
model = Vendor
|
||||||
# fields = [
|
fields = [
|
||||||
# "name",
|
"name",
|
||||||
# "arabic_name",
|
"arabic_name",
|
||||||
# "crn",
|
"crn",
|
||||||
# "vrn",
|
"vrn",
|
||||||
# "email",
|
"email",
|
||||||
# "phone_number",
|
"phone_number",
|
||||||
# "contact_person",
|
"contact_person",
|
||||||
# "address",
|
"address",
|
||||||
# "logo",
|
"logo",
|
||||||
# ]
|
]
|
||||||
|
|
||||||
|
|
||||||
class CarColorsForm(forms.ModelForm):
|
class CarColorsForm(forms.ModelForm):
|
||||||
|
|||||||
@ -1223,9 +1223,10 @@ class VendorCreateView(
|
|||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
dealer = get_user_type(self.request)
|
dealer = get_user_type(self.request)
|
||||||
instance = form.save(commit=False)
|
# instance = form.save(commit=False)
|
||||||
instance.entity_model = dealer.entity
|
form.instance.dealer = dealer
|
||||||
instance.save()
|
# instance.entity_model = dealer.entity
|
||||||
|
form.instance.save()
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user