Projet

Général

Profil

0001-include-filename-only-for-attached-inline-images-128.patch

Serghei Mihai (congés, retour 15/05), 22 août 2016 14:07

Télécharger (1,08 ko)

Voir les différences:

Subject: [PATCH] include filename only for attached inline images (#12872)

 corbo/models.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
corbo/models.py
1
import os
1 2
from datetime import datetime
2 3
import logging
3 4
import urlparse
......
85 86
        storage = DefaultStorage()
86 87
        for img in html_tree.xpath('//img/@src'):
87 88
            img_path = img.lstrip(storage.base_url)
88
            m.attach(filename=img, data=storage.open(img_path))
89
            m.attachments[img].is_inline = True
89
            img_name = os.path.basename(img_path)
90
            m.attach(filename=img_name, data=storage.open(img_path))
91
            m.attachments[img_name].is_inline = True
90 92
        for s in subscriptions:
91 93
            if not s.identifier:
92 94
                continue
93
-