Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
7ad7cc54
Commit
7ad7cc54
authored
Feb 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
interface_post: py3
parent
8d43f46a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
5 deletions
+17
-5
bt5/erp5_interface_post/DocumentTemplateItem/portal_components/document.erp5.InternetMessagePost.py
...em/portal_components/document.erp5.InternetMessagePost.py
+1
-1
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/Event_createPostMessage.py
...rtal_skins/erp5_interface_post/Event_createPostMessage.py
+4
-0
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/InternetMessagePost_getFirstPartFromMultipartMessage.py
...t/InternetMessagePost_getFirstPartFromMultipartMessage.py
+4
-1
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/InternetMessagePost_ingest.py
...l_skins/erp5_interface_post/InternetMessagePost_ingest.py
+7
-1
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/InternetMessagePost_sendMailHostMessage.py
...interface_post/InternetMessagePost_sendMailHostMessage.py
+1
-2
No files found.
bt5/erp5_interface_post/DocumentTemplateItem/portal_components/document.erp5.InternetMessagePost.py
View file @
7ad7cc54
...
@@ -43,7 +43,7 @@ class InternetMessagePost(Item, MailMessageMixin):
...
@@ -43,7 +43,7 @@ class InternetMessagePost(Item, MailMessageMixin):
def
_getMessage
(
self
):
def
_getMessage
(
self
):
return
email
.
message_from_string
(
self
.
getData
())
return
email
.
message_from_string
(
self
.
getData
()
.
decode
()
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'stripMessageId'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'stripMessageId'
)
def
stripMessageId
(
self
,
message_id
):
def
stripMessageId
(
self
,
message_id
):
...
...
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/Event_createPostMessage.py
View file @
7ad7cc54
import
six
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
post_message_post_module
=
portal
.
getDefaultModuleValue
(
post_portal_type
,
None
)
post_message_post_module
=
portal
.
getDefaultModuleValue
(
post_portal_type
,
None
)
if
isinstance
(
post_message_data
,
six
.
text_type
):
post_message_data
=
post_message_data
.
encode
()
message_post
=
post_message_post_module
.
newContent
(
message_post
=
post_message_post_module
.
newContent
(
portal_type
=
post_portal_type
,
portal_type
=
post_portal_type
,
title
=
"Post Message for %s"
%
context
.
getTitle
(),
title
=
"Post Message for %s"
%
context
.
getTitle
(),
...
...
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/InternetMessagePost_getFirstPartFromMultipartMessage.py
View file @
7ad7cc54
...
@@ -5,13 +5,16 @@ multipart message). As for users don't want an accurate representation of
...
@@ -5,13 +5,16 @@ multipart message). As for users don't want an accurate representation of
the message, but a preview, we assume that rendering the first part
the message, but a preview, we assume that rendering the first part
of the multipart message is enough.
of the multipart message is enough.
"""
"""
import
six
import
email
import
email
message
=
email
.
message_from_string
(
context
.
getData
())
message
=
email
.
message_from_string
(
context
.
getData
()
.
decode
()
)
payload
=
message
.
get_payload
()
payload
=
message
.
get_payload
()
while
isinstance
(
payload
,
list
):
while
isinstance
(
payload
,
list
):
payload
=
payload
[
0
].
get_payload
(
decode
=
True
)
payload
=
payload
[
0
].
get_payload
(
decode
=
True
)
if
six
.
PY3
:
payload
=
payload
.
decode
()
return
payload
return
payload
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/InternetMessagePost_ingest.py
View file @
7ad7cc54
...
@@ -5,10 +5,16 @@ in ERP5.
...
@@ -5,10 +5,16 @@ in ERP5.
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
import
email
import
email
import
six
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
email_object
=
email
.
message_from_string
(
context
.
getData
())
if
six
.
PY2
:
message_from_bytes
=
email
.
message_from_string
else
:
message_from_bytes
=
email
.
message_from_bytes
email_object
=
message_from_bytes
(
bytes
(
context
.
getData
()))
mail_message
=
portal
.
portal_contributions
.
newContent
(
mail_message
=
portal
.
portal_contributions
.
newContent
(
container_path
=
'event_module'
,
container_path
=
'event_module'
,
...
...
bt5/erp5_interface_post/SkinTemplateItem/portal_skins/erp5_interface_post/InternetMessagePost_sendMailHostMessage.py
View file @
7ad7cc54
...
@@ -5,5 +5,4 @@
...
@@ -5,5 +5,4 @@
# spawned with parameters :
# spawned with parameters :
# conflict_retry=False,
# conflict_retry=False,
# max_retry=0,
# max_retry=0,
context
.
getPortalObject
().
MailHost
.
send
(
context
.
getData
().
decode
())
context
.
getPortalObject
().
MailHost
.
send
(
context
.
getData
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment