Document upload fix
* fixes some minor issues with the document upload
This commit is contained in:
@@ -177,6 +177,8 @@ class NewDocumentForm(BaseModalForm):
|
||||
|
||||
"""
|
||||
title = forms.CharField(
|
||||
label=_("Title"),
|
||||
label_suffix=_(""),
|
||||
max_length=500,
|
||||
)
|
||||
creation_date = forms.DateField(
|
||||
@@ -195,13 +197,23 @@ class NewDocumentForm(BaseModalForm):
|
||||
label=_("File"),
|
||||
label_suffix=_(""),
|
||||
help_text=_("Must be smaller than 15 Mb"),
|
||||
widget=forms.FileInput(
|
||||
attrs={
|
||||
"class": "w-75"
|
||||
}
|
||||
)
|
||||
)
|
||||
comment = forms.CharField(
|
||||
required=False,
|
||||
label=_("Comment"),
|
||||
label_suffix=_(""),
|
||||
help_text=_("Additional comment on this file"),
|
||||
widget=forms.Textarea()
|
||||
widget=forms.Textarea(
|
||||
attrs={
|
||||
"cols": 30,
|
||||
"rows": 5,
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -222,4 +234,5 @@ class NewDocumentForm(BaseModalForm):
|
||||
document=self.cleaned_data["file"],
|
||||
date_of_creation=self.cleaned_data["creation_date"],
|
||||
)
|
||||
self.instance.documents.add(doc)
|
||||
return doc
|
||||
|
||||
Reference in New Issue
Block a user