diff --git a/employee/templates/tabs/htmx/document_form.html b/employee/templates/tabs/htmx/document_form.html index 74d16d9d6..64101b709 100644 --- a/employee/templates/tabs/htmx/document_form.html +++ b/employee/templates/tabs/htmx/document_form.html @@ -10,13 +10,10 @@
{% csrf_token %} - {% if form.employee_id %} - - {% elif form.candidate_id %} + {% if form.candidate_id %} {% endif %} {{ form.non_field_errors }} -
diff --git a/employee/views.py b/employee/views.py index 1438d3d21..0f68ff3e9 100755 --- a/employee/views.py +++ b/employee/views.py @@ -773,7 +773,8 @@ def file_upload(request, id): except: pass return HttpResponse("") - + else: + logger.error(f"Document upload form errors: {form.errors}") context = {"form": form, "document": document_item} return render(request, "tabs/htmx/document_form.html", context=context) diff --git a/horilla_documents/forms.py b/horilla_documents/forms.py index 88790383b..08d9f853e 100644 --- a/horilla_documents/forms.py +++ b/horilla_documents/forms.py @@ -81,7 +81,14 @@ class DocumentUpdateForm(ModelForm): class Meta: model = Document fields = "__all__" - exclude = ["is_active"] + exclude = [ + "title", + "document_request_id", + "status", + "created_by", + "modified_by", + "employee_id", + ] widgets = { "issue_date": forms.DateInput( attrs={"type": "date", "class": "oh-input w-100"}