forked from mirrors/bookwyrm
Merge pull request #952 from bookwyrm-social/user-reports
Fixes form for reporting users
This commit is contained in:
commit
239d927e94
3 changed files with 4 additions and 3 deletions
|
@ -15,7 +15,9 @@
|
|||
{% csrf_token %}
|
||||
<input type="hidden" name="reporter" value="{{ reporter.id }}">
|
||||
<input type="hidden" name="user" value="{{ user.id }}">
|
||||
{% if status %}
|
||||
<input type="hidden" name="statuses" value="{{ status.id }}">
|
||||
{% endif %}
|
||||
|
||||
<section class="content">
|
||||
<p>{% blocktrans with site_name=site.name %}This report will be sent to {{ site_name }}'s moderators for review.{% endblocktrans %}</p>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<a href="/direct-messages/{{ user|username }}" class="button is-fullwidth is-small">{% trans "Send direct message" %}</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/report_button.html' with user=status.user class="is-fullwidth" %}
|
||||
{% include 'snippets/report_button.html' with user=user class="is-fullwidth" %}
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/block_button.html' with user=user class="is-fullwidth" %}
|
||||
|
|
|
@ -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", "/"))
|
||||
|
|
Loading…
Reference in a new issue