[IMP] better exception handling in case of missing asset
bzr revid: fme@openerp.com-20140425132804-e0dbsl5t2sod7kv5
This commit is contained in:
parent
75408134f9
commit
4b3212c076
|
@ -1084,7 +1084,10 @@ class WebAsset(object):
|
|||
def filename(self):
|
||||
if self._filename is None and self.url:
|
||||
module = filter(None, self.url.split('/'))[0]
|
||||
mpath = openerp.http.addons_manifest[module]['addons_path']
|
||||
try:
|
||||
mpath = openerp.http.addons_manifest[module]['addons_path']
|
||||
except Exception:
|
||||
raise KeyError("Could not find asset '%s' for '%s' addon" % (self.url, module))
|
||||
self._filename = mpath + self.url.replace('/', os.path.sep)
|
||||
return self._filename
|
||||
|
||||
|
|
Loading…
Reference in New Issue