aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/models.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-04-06 14:59:06 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2014-04-06 15:01:24 +0100
commitf7fa15dd365b8903b608834a536e2b83f3cef289 (patch)
tree3f5c108322045fd646b9f073f88985a8e049af53 /layerindex/models.py
parent4c08b28387fcf523048712cffca6f7aad16e6acc (diff)
downloadopenembedded-core-contrib-f7fa15dd365b8903b608834a536e2b83f3cef289.tar.gz
Allow layers to have no master branch
With BSPs being "retired" e.g. in meta-intel, it is possible for layers to not exist on the master branch; since this is legitimate we need the layer index to handle it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/models.py')
-rw-r--r--layerindex/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/layerindex/models.py b/layerindex/models.py
index ae9509ab2a..1f239033da 100644
--- a/layerindex/models.py
+++ b/layerindex/models.py
@@ -63,7 +63,10 @@ class LayerItem(models.Model):
self.status = newstatus
def get_layerbranch(self, branchname):
- res = list(self.layerbranch_set.filter(branch__name=branchname)[:1])
+ if branchname:
+ res = list(self.layerbranch_set.filter(branch__name=branchname)[:1])
+ else:
+ res = list(self.layerbranch_set.all()[:1])
if res:
return res[0]
return None