mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-24 02:04:09 +03:00
Enhanced "search user/groups" response on too many results
This commit is contained in:
parent
b6e5aeac29
commit
a1bf0b92bb
@ -121,8 +121,8 @@ class Authenticators(ModelHandler):
|
||||
return auth.searchUsers(term)
|
||||
else:
|
||||
return auth.searchGroups(term)
|
||||
except Exception:
|
||||
self.invalidRequestException()
|
||||
except Exception as e:
|
||||
self.invalidResponseException('{}'.format(e))
|
||||
|
||||
def test(self, type_):
|
||||
from uds.core.Environment import Environment
|
||||
|
@ -44,7 +44,6 @@ from uds.core.util import permissions
|
||||
from uds.core.util.model import processUuid
|
||||
from uds.models import Tag
|
||||
|
||||
|
||||
import fnmatch
|
||||
import re
|
||||
import itertools
|
||||
@ -54,8 +53,7 @@ import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
__updated__ = '2017-10-25'
|
||||
|
||||
__updated__ = '2018-02-01'
|
||||
|
||||
# a few constants
|
||||
OVERVIEW = 'overview'
|
||||
@ -256,6 +254,10 @@ class BaseModelHandler(Handler):
|
||||
message = _('Invalid Request') if message is None else message
|
||||
raise RequestError('{} {}: {}'.format(message, self.__class__, self._args))
|
||||
|
||||
def invalidResponseException(self, message=None):
|
||||
message = 'Invalid response' if message is None else message
|
||||
raise ResponseError(message)
|
||||
|
||||
def invalidMethodException(self):
|
||||
'''
|
||||
Raises a NotFound exception with translated "Method not found" string to current locale
|
||||
|
Loading…
x
Reference in New Issue
Block a user