Option to deactivate reported users
This commit is contained in:
@ -20,7 +20,7 @@ from .notifications import Notifications
|
||||
from .outbox import Outbox
|
||||
from .reading import edit_readthrough, create_readthrough, delete_readthrough
|
||||
from .reading import start_reading, finish_reading, delete_progressupdate
|
||||
from .reports import Report, Reports, make_report, resolve_report
|
||||
from .reports import Report, Reports, make_report, resolve_report, deactivate_user
|
||||
from .rss_feed import RssFeed
|
||||
from .password import PasswordResetRequest, PasswordReset, ChangePassword
|
||||
from .search import Search
|
||||
|
@ -50,6 +50,16 @@ class Report(View):
|
||||
return TemplateResponse(request, "moderation/report.html", data)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("bookwyrm_moderate_user")
|
||||
def deactivate_user(_, report_id):
|
||||
""" mark an account as inactive """
|
||||
report = get_object_or_404(models.Report, id=report_id)
|
||||
report.user.is_active = not report.user.is_active
|
||||
report.user.save()
|
||||
return redirect("settings-report", report.id)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required("bookwyrm_moderate_post")
|
||||
def resolve_report(_, report_id):
|
||||
|
Reference in New Issue
Block a user