aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-10-25 20:58:31 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-10-26 15:41:32 +1300
commit7ddf8f58d63d5571df7b952a98c13c6a7c39e074 (patch)
tree14082ac5db0072318e01ef05f5fef2753c64f836 /layerindex
parentd5b0d578a6fc5c4acb7a8cf957afb5f18e9f6ad3 (diff)
downloadopenembedded-core-contrib-7ddf8f58d63d5571df7b952a98c13c6a7c39e074.tar.gz
recipedetail: don't show homepage as link if not URL
Sometimes people put values that aren't URLs into the HOMEPAGE variable. If that's the case, then we should not turn that value into a link which will be invalid. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex')
-rw-r--r--layerindex/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/layerindex/models.py b/layerindex/models.py
index 869d4a3e10..746fad445f 100644
--- a/layerindex/models.py
+++ b/layerindex/models.py
@@ -292,6 +292,12 @@ class Recipe(models.Model):
else:
return self.filename.split('_')[0]
+ def homepage_url_only(self):
+ if '://' in self.homepage:
+ return self.homepage
+ else:
+ return None
+
def __str__(self):
return os.path.join(self.filepath, self.filename)