muted users: Add support to muting bots.

We intentionally disallow muting bots previously upon
a pending design decision in #16915.
This lifts that constraint.

Fixes #22693.
This commit is contained in:
Zixuan James Li
2023-06-13 12:15:36 -04:00
committed by Tim Abbott
parent 27664459cb
commit 693b3679e3
6 changed files with 17 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ def mute_user(request: HttpRequest, user_profile: UserProfile, muted_user_id: in
raise JsonableError(_("Cannot mute self"))
muted_user = access_user_by_id(
user_profile, muted_user_id, allow_bots=False, allow_deactivated=True, for_admin=False
user_profile, muted_user_id, allow_bots=True, allow_deactivated=True, for_admin=False
)
date_muted = timezone_now()
@@ -32,7 +32,7 @@ def unmute_user(
request: HttpRequest, user_profile: UserProfile, muted_user_id: int
) -> HttpResponse:
muted_user = access_user_by_id(
user_profile, muted_user_id, allow_bots=False, allow_deactivated=True, for_admin=False
user_profile, muted_user_id, allow_bots=True, allow_deactivated=True, for_admin=False
)
mute_object = get_mute_object(user_profile, muted_user)