From e0c16b21e950fee1812b436daf640fed9595b7b5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 17 Apr 2021 10:28:03 -0700 Subject: [PATCH] Fixes form for reporting users --- bookwyrm/templates/moderation/report_modal.html | 2 ++ bookwyrm/templates/snippets/user_options.html | 2 +- bookwyrm/views/reports.py | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bookwyrm/templates/moderation/report_modal.html b/bookwyrm/templates/moderation/report_modal.html index ce8408ee..0d6504ab 100644 --- a/bookwyrm/templates/moderation/report_modal.html +++ b/bookwyrm/templates/moderation/report_modal.html @@ -15,7 +15,9 @@ {% csrf_token %} +{% if status %} +{% endif %}

{% blocktrans with site_name=site.name %}This report will be sent to {{ site_name }}'s moderators for review.{% endblocktrans %}

diff --git a/bookwyrm/templates/snippets/user_options.html b/bookwyrm/templates/snippets/user_options.html index 585417c7..ec772e54 100644 --- a/bookwyrm/templates/snippets/user_options.html +++ b/bookwyrm/templates/snippets/user_options.html @@ -13,7 +13,7 @@ {% trans "Send direct message" %}
  • - {% include 'snippets/report_button.html' with user=status.user class="is-fullwidth" %} + {% include 'snippets/report_button.html' with user=user class="is-fullwidth" %}
  • {% include 'snippets/block_button.html' with user=user class="is-fullwidth" %} diff --git a/bookwyrm/views/reports.py b/bookwyrm/views/reports.py index cb1a62ff..f2566494 100644 --- a/bookwyrm/views/reports.py +++ b/bookwyrm/views/reports.py @@ -98,8 +98,7 @@ def make_report(request): """ a user reports something """ form = forms.ReportForm(request.POST) if not form.is_valid(): - print(form.errors) - return redirect(request.headers.get("Referer", "/")) + raise ValueError(form.errors) form.save() return redirect(request.headers.get("Referer", "/"))