Permalink
Browse files

💚

  • Loading branch information...
RafiZz committed Nov 21, 2018
1 parent c044207 commit 7f16ab85e37d2303fc336f49215353f80bf1ab50
Showing with 2 additions and 3 deletions.
  1. +2 −3 ir_attachment_url/models/ir_http.py
@@ -98,7 +98,7 @@ def binary_content(cls, xmlid=None, model='ir.attachment', id=None, field='datas
# attachment by url check
module_resource_path = None
if model == 'ir.attachment' and obj.type == 'url' and obj.url:
url_match = re.match("^/(\w+)/(.+)$", obj.url)
url_match = re.match(r"^/(\w+)/(.+)$", obj.url)
if url_match:
module = url_match.group(1)
module_path = get_module_path(module)
@@ -109,8 +109,7 @@ def binary_content(cls, xmlid=None, model='ir.attachment', id=None, field='datas
if module_resource_path.startswith(module_path):
with open(module_resource_path, 'rb') as f:
content = base64.b64encode(f.read())
# commented out because the variable is not used and a lint error occurs
# last_update = pycompat.text_type(os.path.getmtime(module_resource_path))
# 'last_update' variable removed for lint error fix

if not module_resource_path:
module_resource_path = obj.url

0 comments on commit 7f16ab8

Please sign in to comment.