Commit d5a43991 authored by Romain Bignon's avatar Romain Bignon

when getting an object, if at least one is found, display errors but correctly...

when getting an object, if at least one is found, display errors but correctly return the found object
parent e9c047ce
......@@ -260,11 +260,18 @@ class ReplApplication(Cmd, ConsoleApplication):
if getattr(actual_backend, method, None) is not None:
new_backend_names.append(backend)
backend_names = tuple(new_backend_names)
for backend, objiter in self.do(method, _id, backends=backend_names, fields=fields, **kargs):
if objiter:
obj = objiter
if objiter.id == _id:
return obj
try:
for backend, objiter in self.do(method, _id, backends=backend_names, fields=fields, **kargs):
if objiter:
obj = objiter
if objiter.id == _id:
return obj
except CallErrors as e:
if obj is not None:
self.bcall_errors_handler(e)
else:
raise
return obj
def get_object_list(self, method=None, *args, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment