fixing up REST exceptions: notSupported

This commit is contained in:
Adolfo Gómez García 2019-09-12 12:47:23 +02:00
parent 29cb8b6a39
commit 899df5a6a6
2 changed files with 3 additions and 3 deletions

View File

@ -130,7 +130,7 @@ class Authenticators(ModelHandler):
canDoSearch = type_ == 'user' and (auth.searchUsers != auths.Authenticator.searchUsers) or (auth.searchGroups != auths.Authenticator.searchGroups)
if canDoSearch is False:
self.notSupported()
raise self.notSupported()
if type_ == 'user':
return list(auth.searchUsers(term))[:limit]

View File

@ -291,8 +291,8 @@ class BaseModelHandler(Handler):
def accessDenied(self, message: typing.Optional[str] = None) -> HandlerError:
return AccessDenied(message or _('Access denied'))
def notSupported(self, message: typing.Optional[str] = None) -> None:
raise NotSupportedError(message or _('Operation not supported'))
def notSupported(self, message: typing.Optional[str] = None) -> HandlerError:
return NotSupportedError(message or _('Operation not supported'))
# Success methods
def success(self) -> str: