diff --git a/app/blueprints/report/__init__.py b/app/blueprints/report/__init__.py index bf8a999d..ef9f5956 100644 --- a/app/blueprints/report/__init__.py +++ b/app/blueprints/report/__init__.py @@ -43,8 +43,8 @@ def report(): if url: url = abs_url_samesite(url) - form = ReportForm(formdata=request.form) - if form.validate_on_submit(): + form = ReportForm(formdata=request.form) if current_user.is_authenticated else None + if form and form.validate_on_submit(): if current_user.is_authenticated: user_info = f"{current_user.username}" else: diff --git a/app/templates/report/index.html b/app/templates/report/index.html index c18d377e..7306b741 100644 --- a/app/templates/report/index.html +++ b/app/templates/report/index.html @@ -6,9 +6,23 @@ {% block content %} -{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %}
+ {{ _("Due to spam, we no longer accept reports from anonymous users on this form.") }} + {{ _("Please sign in or contact the admin in another way") }} +
++ Login + Contact the admin +
+ +{% else %} + +{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %} + +{% endif %} + {% endblock %}