core: fixed profile key detection in getClients + raise DataError on empty profile
This commit is contained in:
parent
2ca6788477
commit
a4b122094c
1 changed files with 3 additions and 1 deletions
|
|
@ -455,13 +455,15 @@ class SAT(service.Service):
|
|||
@param profile_key: %(doc_profile_key)s
|
||||
@return: list of clients
|
||||
"""
|
||||
if not profile_key:
|
||||
raise exceptions.DataError(_(u'profile_key must not be empty'))
|
||||
try:
|
||||
profile = self.memory.getProfileName(profile_key, True)
|
||||
except exceptions.ProfileUnknownError:
|
||||
return []
|
||||
if profile == C.PROF_KEY_ALL:
|
||||
return self.profiles.values()
|
||||
elif profile.count('@') > 1:
|
||||
elif profile[0] == '@': # only profile keys can start with "@"
|
||||
raise exceptions.ProfileKeyUnknown
|
||||
return [self.profiles[profile]]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue