Skip to content

Commit 48f192a

Browse files
authored
SUP-40979 Fix sending zem document by mail (#304)
1 parent 5c4122f commit 48f192a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

news/SUP-40979.bugfix

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix sending zem document by mail
2+
[jchandelle]

src/Products/urban/send_mail_action/adapter.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
@adapter(Interface, Interface, ISendMailAction)
1414
class GetDocumentToAttach(mail_with_attachment.GetDocumentToAttach):
1515
def __call__(self):
16-
return [api.content.get(UID=file) for file in getattr(self.event, "files", [])]
16+
return [
17+
api.content.get(path=file.encode("utf-8"))
18+
for file in getattr(self.event, "files", [])
19+
]

src/Products/urban/vocabularies.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,17 @@ def __call__(self, context):
288288
class LicenceDocumentsVocabulary(object):
289289
implements(IVocabularyFactory)
290290

291+
def get_path(sefl, obj):
292+
return "/".join(obj.getPhysicalPath())
293+
291294
def __call__(self, context):
292295
contexts = get_licence_context(context, get_all_object=True)
293296
output = []
294297
if contexts is None:
295298
return SimpleVocabulary(output)
296299
for context in contexts:
297300
docs = [
298-
SimpleTerm(doc.UID(), doc.UID(), doc.Title())
301+
SimpleTerm(self.get_path(doc), self.get_path(doc), doc.Title())
299302
for doc in context.listFolderContents(
300303
contentFilter={
301304
"portal_type": ["ATFile", "ATImage", "File", "Image"]

0 commit comments

Comments
 (0)