diff --git a/cyborgclient/common/base.py b/cyborgclient/common/base.py index 6c87784..9d1f6b6 100644 --- a/cyborgclient/common/base.py +++ b/cyborgclient/common/base.py @@ -32,10 +32,7 @@ def getid(obj): Abstracts the common pattern of allowing both an object or an object's ID (UUID) as a parameter when dealing with relationships. """ - try: - return obj.id - except AttributeError: - return obj + return getattr(obj, 'id', obj) class Manager(object):