diff --git a/hypha/apply/projects/forms/project.py b/hypha/apply/projects/forms/project.py index f503671a19a49ca20e0d91cf3b08511b3ef3d380..bee6ff8b2a0c77f37a51c0381f5739eb9cfc4fc9 100644 --- a/hypha/apply/projects/forms/project.py +++ b/hypha/apply/projects/forms/project.py @@ -172,16 +172,16 @@ class UploadDocumentForm(FileFormMixin, forms.ModelForm): document = SingleFileField(label=_('Document'), required=True) class Meta: - fields = ['title', 'category', 'document'] + fields = ['category', 'document'] model = PacketFile - widgets = {'title': forms.TextInput()} - labels = { - "title": _('File Name'), - } def __init__(self, user=None, instance=None, *args, **kwargs): super().__init__(*args, **kwargs) + def save(self, commit=True): + self.instance.title = self.instance.document + return super(UploadDocumentForm, self).save(commit=True) + class UpdateProjectLeadForm(forms.ModelForm): class Meta: diff --git a/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html b/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html index e8f99c9a10b27ccae1d4f38266b7f07500f5b671..8b65f8b5b13a038c1324d25b272e48345f516ed7 100644 --- a/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html +++ b/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html @@ -156,6 +156,6 @@ <div class="modal" id="upload-supporting-doc"> <h4 class="modal__header-bar">{% trans "Upload a new document" %}</h4> <p></p> - {% trans "Upload" as upload %} - {% include 'funds/includes/delegated_form_base.html' with form=document_form value=upload %} + {% trans "Submit" as submit %} + {% include 'funds/includes/delegated_form_base.html' with form=document_form value=submit %} </div>