From a3371d538ca00e5829468c87923dfe54dc8d76d9 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 24 May 2024 01:31:33 +0100 Subject: [PATCH] Fix two form and validation issues --- app/logic/packages.py | 5 ++--- app/templates/macros/forms.html | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/logic/packages.py b/app/logic/packages.py index ae4f2dca..6a76ba24 100644 --- a/app/logic/packages.py +++ b/app/logic/packages.py @@ -23,7 +23,7 @@ from flask_babel import lazy_gettext, LazyString from app.logic.LogicError import LogicError from app.models import User, Package, PackageType, MetaPackage, Tag, ContentWarning, db, Permission, AuditSeverity, \ - License, UserRank, PackageDevState + License, PackageDevState from app.utils import add_audit_log, has_blocked_domains, diff_dictionaries, describe_difference from app.utils.url import clean_youtube_url @@ -103,8 +103,7 @@ def validate(data: dict): if value is not None: check(value.startswith("http://") or value.startswith("https://"), key + " must start with http:// or https://") - - check(validators.url(value, public=True), key + " must be a valid URL") + check(validators.url(value), key + " must be a valid URL") def do_edit_package(user: User, package: Package, was_new: bool, was_web: bool, data: dict, diff --git a/app/templates/macros/forms.html b/app/templates/macros/forms.html index dfbdb1c8..e18168dc 100644 --- a/app/templates/macros/forms.html +++ b/app/templates/macros/forms.html @@ -141,7 +141,7 @@ {% macro render_radio_field(field, hint=None, label=None, label_visible=true) -%}
{{ render_label(field, label, label_visible) }} - {% for value, label, checked in field.iter_choices() %} + {% for value, label, checked, render_kw in field.iter_choices() %}