diff --git a/library/forms/uploadform.py b/library/forms/uploadform.py index 92544b9..44f92de 100644 --- a/library/forms/uploadform.py +++ b/library/forms/uploadform.py @@ -31,7 +31,9 @@ class PublicationForm(FlaskForm): ], ) year = IntegerField( - "Year:", [validators.InputRequired(), NumberRange(min=0, max=2050)] + "Year:", + [validators.InputRequired(), NumberRange(min=0, max=2050)], + default=2023 ) fields = StringField("Fields:") type = StringField( @@ -55,6 +57,10 @@ class PublicationForm(FlaskForm): "Image of the book:", validators=[FileAllowed(["jpg", "png", "gif"], "Images only!")], ) + pdf = FileField( + "Pdf of the book:", + validators=[FileAllowed(["pdf"], "Only pdf uploads supported")], + ) secret = StringField( "Librarians secret:", [ diff --git a/library/templates/upload.html b/library/templates/upload.html index bbf5630..49df8be 100644 --- a/library/templates/upload.html +++ b/library/templates/upload.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block main %}