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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ekaterina
erp5
Commits
016766c1
Commit
016766c1
authored
Aug 21, 2017
by
Boxiang Sun
Committed by
Tristan Cavelier
Aug 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_post: Change the post state from "draft" to "publish" after add that post.
parent
97448385
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPost.py
...eItem/portal_skins/erp5_post/PostModule_createHTMLPost.py
+5
-4
No files found.
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_createHTMLPost.py
View file @
016766c1
...
@@ -4,7 +4,7 @@ now = DateTime()
...
@@ -4,7 +4,7 @@ now = DateTime()
# create an HTML Post
# create an HTML Post
post_module
=
portal
.
post_module
post_module
=
portal
.
post_module
post
_1
=
post_module
.
newContent
(
portal_type
=
'HTML Post'
)
post
=
post_module
.
newContent
(
portal_type
=
'HTML Post'
)
# get the related object
# get the related object
object_list
=
portal
.
portal_catalog
(
relative_url
=
follow_up
)
# with id keyword, this function will return a sequence data type which contains one element.
object_list
=
portal
.
portal_catalog
(
relative_url
=
follow_up
)
# with id keyword, this function will return a sequence data type which contains one element.
...
@@ -18,7 +18,7 @@ follow_up_object.edit(
...
@@ -18,7 +18,7 @@ follow_up_object.edit(
modification_date
=
now
modification_date
=
now
)
)
post
_1
.
edit
(
post
.
edit
(
start_date
=
now
,
start_date
=
now
,
follow_up_value
=
follow_up_object
,
follow_up_value
=
follow_up_object
,
predecessor_value
=
predecessor
if
predecessor
else
None
,
predecessor_value
=
predecessor
if
predecessor
else
None
,
...
@@ -32,12 +32,13 @@ if file != "undefined":
...
@@ -32,12 +32,13 @@ if file != "undefined":
'file'
:
file
}
'file'
:
file
}
document
=
context
.
Base_contribute
(
**
document_kw
)
document
=
context
.
Base_contribute
(
**
document_kw
)
# set relation between post and document
# set relation between post and document
post
_1
.
setSuccessorValueList
([
document
])
post
.
setSuccessorValueList
([
document
])
# depending on security model this should be changed accordingly
# depending on security model this should be changed accordingly
document
.
publish
()
document
.
publish
()
post
.
publish
()
# We need to reindex the object on server. So the page will get the post which
# We need to reindex the object on server. So the page will get the post which
# just submmitted.
# just submmitted.
post
_1
.
immediateReindexObject
()
post
.
immediateReindexObject
()
return
return
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