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"]
|
||||
|
||||
|
||||
class VendorForm(VendorModelForm):
|
||||
pass
|
||||
# class VendorForm(forms.ModelForm):
|
||||
# class Meta:
|
||||
# model = Vendor
|
||||
# fields = [
|
||||
# "name",
|
||||
# "arabic_name",
|
||||
# "crn",
|
||||
# "vrn",
|
||||
# "email",
|
||||
# "phone_number",
|
||||
# "contact_person",
|
||||
# "address",
|
||||
# "logo",
|
||||
# ]
|
||||
# class VendorForm(VendorModelForm):
|
||||
# pass
|
||||
class VendorForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Vendor
|
||||
fields = [
|
||||
"name",
|
||||
"arabic_name",
|
||||
"crn",
|
||||
"vrn",
|
||||
"email",
|
||||
"phone_number",
|
||||
"contact_person",
|
||||
"address",
|
||||
"logo",
|
||||
]
|
||||
|
||||
|
||||
class CarColorsForm(forms.ModelForm):
|
||||
|
||||
@ -1223,9 +1223,10 @@ class VendorCreateView(
|
||||
|
||||
def form_valid(self, form):
|
||||
dealer = get_user_type(self.request)
|
||||
instance = form.save(commit=False)
|
||||
instance.entity_model = dealer.entity
|
||||
instance.save()
|
||||
# instance = form.save(commit=False)
|
||||
form.instance.dealer = dealer
|
||||
# instance.entity_model = dealer.entity
|
||||
form.instance.save()
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user