when getting an object, if at least one is found, display errors but correctly return the found object
This commit is contained in:
parent
e9c047ce93
commit
d5a43991b6
1 changed files with 12 additions and 5 deletions
|
|
@ -260,11 +260,18 @@ class ReplApplication(Cmd, ConsoleApplication):
|
||||||
if getattr(actual_backend, method, None) is not None:
|
if getattr(actual_backend, method, None) is not None:
|
||||||
new_backend_names.append(backend)
|
new_backend_names.append(backend)
|
||||||
backend_names = tuple(new_backend_names)
|
backend_names = tuple(new_backend_names)
|
||||||
for backend, objiter in self.do(method, _id, backends=backend_names, fields=fields, **kargs):
|
try:
|
||||||
if objiter:
|
for backend, objiter in self.do(method, _id, backends=backend_names, fields=fields, **kargs):
|
||||||
obj = objiter
|
if objiter:
|
||||||
if objiter.id == _id:
|
obj = objiter
|
||||||
return obj
|
if objiter.id == _id:
|
||||||
|
return obj
|
||||||
|
except CallErrors as e:
|
||||||
|
if obj is not None:
|
||||||
|
self.bcall_errors_handler(e)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
def get_object_list(self, method=None, *args, **kwargs):
|
def get_object_list(self, method=None, *args, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue