[UPDT] BASE: Updated base module by adding non field errors in company form html
This commit is contained in:
@@ -208,9 +208,11 @@ class ModelForm(forms.ModelForm):
|
||||
label = ""
|
||||
if field.label is not None:
|
||||
label = _(field.label.title())
|
||||
existing_class = field.widget.attrs.get("class", "oh-input w-100")
|
||||
field.widget.attrs.update(
|
||||
{"class": "oh-input w-100", "placeholder": label}
|
||||
{"class": f"{existing_class}", "placeholder": label}
|
||||
)
|
||||
|
||||
elif isinstance(widget, (forms.Select,)):
|
||||
field.empty_label = None
|
||||
if not isinstance(field, forms.ModelMultipleChoiceField):
|
||||
|
||||
@@ -70,7 +70,7 @@ class Company(HorillaModel):
|
||||
Company model
|
||||
"""
|
||||
|
||||
company = models.CharField(max_length=50)
|
||||
company = models.CharField(max_length=50, verbose_name=_("Name"))
|
||||
hq = models.BooleanField(default=False)
|
||||
address = models.TextField(max_length=255)
|
||||
country = models.CharField(max_length=50)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="oh-inner-sidebar-content__body">
|
||||
<div class="col-12">{{form.non_field_errors}}</div>
|
||||
<!-- Company Name -->
|
||||
<div class="oh-input-group mb-2">
|
||||
<label for="{{ form.company.id_for_label }}" class="mb-1">{{ form.company.label }}</label>
|
||||
|
||||
Reference in New Issue
Block a user