Comments on reports

This commit is contained in:
Mouse Reeve
2021-03-12 15:56:54 -08:00
parent 46581e37e2
commit 9245b9d9ca
3 changed files with 36 additions and 6 deletions

View File

@ -46,9 +46,21 @@ class Report(View):
def get(self, request, report_id):
""" load a report """
data = {"report": get_object_or_404(models.Report, id=report_id)}
data = {
"report": get_object_or_404(models.Report, id=report_id),
}
return TemplateResponse(request, "moderation/report.html", data)
def post(self, request, report_id):
""" comment on a report """
report = get_object_or_404(models.Report, id=report_id)
models.ReportComment.objects.create(
user=request.user,
report=report,
note=request.POST.get("note"),
)
return redirect("settings-report", report.id)
@login_required
@permission_required("bookwyrm_moderate_user")