Compare commits

...

4 Commits

Author SHA1 Message Date
Andrew Morgan
6f98bc6512 Don't mention other PR 2019-07-31 14:51:04 +01:00
Andrew Morgan
50a63d5fda Fix bug # in changelog entry 2019-07-24 15:16:51 +01:00
Andrew Morgan
280bfb15ce Add changelog 2019-07-15 13:30:35 +01:00
Andrew Morgan
fff89c33d8 Add USER_DEACTIVATED error code and use it 2019-07-15 13:25:52 +01:00
2 changed files with 3 additions and 1 deletions

1
changelog.d/5686.feature Normal file
View File

@@ -0,0 +1 @@
Use `M_USER_DEACTIVATED` instead of `M_UNKNOWN` for errcode when a deactivated user attempts to login.

View File

@@ -61,6 +61,7 @@ class Codes(object):
INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION"
WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
EXPIRED_ACCOUNT = "ORG_MATRIX_EXPIRED_ACCOUNT"
USER_DEACTIVATED = "M_USER_DEACTIVATED"
class CodeMessageException(RuntimeError):
@@ -151,7 +152,7 @@ class UserDeactivatedError(SynapseError):
msg (str): The human-readable error message
"""
super(UserDeactivatedError, self).__init__(
code=http_client.FORBIDDEN, msg=msg, errcode=Codes.UNKNOWN
code=http_client.FORBIDDEN, msg=msg, errcode=Codes.USER_DEACTIVATED
)