forked from shaba/openuds
fixing up REST exceptions: notSupported
This commit is contained in:
parent
29cb8b6a39
commit
899df5a6a6
@ -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]
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user