Skip to content

Commit

Permalink
Location descriptor is not always there, and will return (None, None)…
Browse files Browse the repository at this point in the history
… if it isnt. I think that makes more sense than raising a cryptic exception.
  • Loading branch information
dmoreno-harveyRoad committed Feb 7, 2018
1 parent 24e5b2b commit e34234f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion genologics/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __init__(self, instance, *args, **kwargs):

@property
def rootnode(self):
if not self._rootnode:
if self._rootnode is None:
self._rootnode = self.instance.root
for rootkey in self.rootkeys:
self._rootnode = self._rootnode.find(rootkey)
Expand Down Expand Up @@ -553,6 +553,8 @@ def __get__(self, instance, cls):
from genologics.entities import Container
instance.get()
node = instance.root.find(self.tag)
if node is None:
return (None,None)
uri = node.find('container').attrib['uri']
return Container(instance.lims, uri=uri), node.find('value').text

Expand Down

0 comments on commit e34234f

Please sign in to comment.