diff --git a/app/blueprints/packages/releases.py b/app/blueprints/packages/releases.py index 08c48e3b..6079f5de 100644 --- a/app/blueprints/packages/releases.py +++ b/app/blueprints/packages/releases.py @@ -49,11 +49,11 @@ def get_mt_releases(is_max): class CreatePackageReleaseForm(FlaskForm): - title = StringField(lazy_gettext("Title"), [InputRequired(), Length(1, 30)]) - uploadOpt = RadioField(lazy_gettext("Method"), choices=[("upload", lazy_gettext("File Upload"))], default="upload") - vcsLabel = StringField(lazy_gettext("Git reference (ie: commit hash, branch, or tag)"), default=None) - fileUpload = FileField(lazy_gettext("File Upload")) - min_rel = QuerySelectField(lazy_gettext("Minimum Minetest Version"), [InputRequired()], + title = StringField(lazy_gettext("Title"), [InputRequired(), Length(1, 30)]) + uploadOpt = RadioField(lazy_gettext("Method"), choices=[("upload", lazy_gettext("File Upload"))], default="upload") + vcsLabel = StringField(lazy_gettext("Git reference (ie: commit hash, branch, or tag)"), default=None) + file_upload = FileField(lazy_gettext("File Upload")) + min_rel = QuerySelectField(lazy_gettext("Minimum Minetest Version"), [InputRequired()], query_factory=lambda: get_mt_releases(False), get_pk=lambda a: a.id, get_label=lambda a: a.name) max_rel = QuerySelectField(lazy_gettext("Maximum Minetest Version"), [InputRequired()], query_factory=lambda: get_mt_releases(True), get_pk=lambda a: a.id, get_label=lambda a: a.name) @@ -97,7 +97,7 @@ def create_release(package): form.vcsLabel.data, form.min_rel.data.getActual(), form.max_rel.data.getActual()) else: rel = do_create_zip_release(current_user, package, form.title.data, - form.fileUpload.data, form.min_rel.data.getActual(), form.max_rel.data.getActual()) + form.file_upload.data, form.min_rel.data.getActual(), form.max_rel.data.getActual()) return redirect(url_for("tasks.check", id=rel.task_id, r=rel.getEditURL())) except LogicError as e: flash(e.message, "danger") diff --git a/app/blueprints/packages/screenshots.py b/app/blueprints/packages/screenshots.py index b6a2cc80..1912b35b 100644 --- a/app/blueprints/packages/screenshots.py +++ b/app/blueprints/packages/screenshots.py @@ -31,7 +31,7 @@ from app.logic.screenshots import do_create_screenshot, do_order_screenshots class CreateScreenshotForm(FlaskForm): title = StringField(lazy_gettext("Title/Caption"), [Optional(), Length(-1, 100)]) - fileUpload = FileField(lazy_gettext("File Upload"), [InputRequired()]) + file_upload = FileField(lazy_gettext("File Upload"), [InputRequired()]) submit = SubmitField(lazy_gettext("Save")) @@ -87,7 +87,7 @@ def create_screenshot(package): form = CreateScreenshotForm() if form.validate_on_submit(): try: - do_create_screenshot(current_user, package, form.title.data, form.fileUpload.data, False) + do_create_screenshot(current_user, package, form.title.data, form.file_upload.data, False) return redirect(package.getURL("packages.screenshots")) except LogicError as e: flash(e.message, "danger") diff --git a/app/templates/packages/release_new.html b/app/templates/packages/release_new.html index 898756d8..2e1c819f 100644 --- a/app/templates/packages/release_new.html +++ b/app/templates/packages/release_new.html @@ -51,7 +51,7 @@ pattern="[A-Za-z0-9/._-]+") }} {% endif %} - {{ render_field(form.fileUpload, fieldclass="form-control-file", class_="mt-3", accept=".zip") }} + {{ render_field(form.file_upload, fieldclass="form-control-file", class_="mt-3", accept=".zip") }}
{{ _("Take a look at the Package Configuration and Releases Guide for @@ -94,10 +94,10 @@