Stop shadow-banned users from sending invites. (#8095)

This commit is contained in:
Patrick Cloke 2020-08-20 15:07:42 -04:00 committed by GitHub
parent 318f4e738e
commit e259d63f73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 226 additions and 31 deletions

View file

@ -604,3 +604,11 @@ class HttpResponseException(CodeMessageException):
errmsg = j.pop("error", self.msg)
return ProxiedRequestError(self.code, errmsg, errcode, j)
class ShadowBanError(Exception):
"""
Raised when a shadow-banned user attempts to perform an action.
This should be caught and a proper "fake" success response sent to the user.
"""