forked from mirrors/bookwyrm
Changes language from "deactivate" to "suspend"
This commit is contained in:
parent
1542866b6c
commit
da19089d34
5 changed files with 15 additions and 13 deletions
|
@ -5,12 +5,12 @@
|
||||||
<p class="mr-1">
|
<p class="mr-1">
|
||||||
<a class="button" href="{% url 'direct-messages-user' user.username %}">{% trans "Send direct message" %}</a>
|
<a class="button" href="{% url 'direct-messages-user' user.username %}">{% trans "Send direct message" %}</a>
|
||||||
</p>
|
</p>
|
||||||
<form name="deactivate" method="post" action="">
|
<form name="suspend" method="post" action="{% url 'settings-report-suspend' user.id %}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{% if user.is_active %}
|
{% if user.is_active %}
|
||||||
<button type="submit" class="button is-danger is-light">{% trans "Deactivate user" %}</button>
|
<button type="submit" class="button is-danger is-light">{% trans "Suspend user" %}</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button class="button">{% trans "Reactivate user" %}</button>
|
<button class="button">{% trans "Un-suspend user" %}</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -63,7 +63,7 @@ urlpatterns = [
|
||||||
re_path(
|
re_path(
|
||||||
r"^settings/users/(?P<user>\d+)/?$",
|
r"^settings/users/(?P<user>\d+)/?$",
|
||||||
views.UserAdmin.as_view(),
|
views.UserAdmin.as_view(),
|
||||||
name="settings-user"
|
name="settings-user",
|
||||||
),
|
),
|
||||||
re_path(
|
re_path(
|
||||||
r"^settings/federation/?$",
|
r"^settings/federation/?$",
|
||||||
|
@ -120,9 +120,9 @@ urlpatterns = [
|
||||||
name="settings-report",
|
name="settings-report",
|
||||||
),
|
),
|
||||||
re_path(
|
re_path(
|
||||||
r"^settings/reports/(?P<report_id>\d+)/deactivate/?$",
|
r"^settings/reports/(?P<user_id>\d+)/suspend/?$",
|
||||||
views.deactivate_user,
|
views.suspend_user,
|
||||||
name="settings-report-deactivate",
|
name="settings-report-suspend",
|
||||||
),
|
),
|
||||||
re_path(
|
re_path(
|
||||||
r"^settings/reports/(?P<report_id>\d+)/resolve/?$",
|
r"^settings/reports/(?P<report_id>\d+)/resolve/?$",
|
||||||
|
|
|
@ -25,7 +25,7 @@ from .notifications import Notifications
|
||||||
from .outbox import Outbox
|
from .outbox import Outbox
|
||||||
from .reading import edit_readthrough, create_readthrough, delete_readthrough
|
from .reading import edit_readthrough, create_readthrough, delete_readthrough
|
||||||
from .reading import start_reading, finish_reading, delete_progressupdate
|
from .reading import start_reading, finish_reading, delete_progressupdate
|
||||||
from .reports import Report, Reports, make_report, resolve_report, deactivate_user
|
from .reports import Report, Reports, make_report, resolve_report, suspend_user
|
||||||
from .rss_feed import RssFeed
|
from .rss_feed import RssFeed
|
||||||
from .password import PasswordResetRequest, PasswordReset, ChangePassword
|
from .password import PasswordResetRequest, PasswordReset, ChangePassword
|
||||||
from .search import Search
|
from .search import Search
|
||||||
|
|
|
@ -74,12 +74,13 @@ class Report(View):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@permission_required("bookwyrm_moderate_user")
|
@permission_required("bookwyrm_moderate_user")
|
||||||
def deactivate_user(_, report_id):
|
def suspend_user(_, user_id):
|
||||||
""" mark an account as inactive """
|
""" mark an account as inactive """
|
||||||
report = get_object_or_404(models.Report, id=report_id)
|
user = get_object_or_404(models.User, id=user_id)
|
||||||
report.user.is_active = not report.user.is_active
|
user.is_active = not user.is_active
|
||||||
report.user.save()
|
# this isn't a full deletion, so we don't want to tell the world
|
||||||
return redirect("settings-report", report.id)
|
user.save(broadcast=False)
|
||||||
|
return redirect("settings-user", user.id)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
|
|
@ -57,6 +57,7 @@ class UserAdminList(View):
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "user_admin/user_admin.html", data)
|
return TemplateResponse(request, "user_admin/user_admin.html", data)
|
||||||
|
|
||||||
|
|
||||||
@method_decorator(login_required, name="dispatch")
|
@method_decorator(login_required, name="dispatch")
|
||||||
@method_decorator(
|
@method_decorator(
|
||||||
permission_required("bookwyrm.moderate_users", raise_exception=True),
|
permission_required("bookwyrm.moderate_users", raise_exception=True),
|
||||||
|
|
Loading…
Reference in a new issue