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
Joshua
erp5
Commits
0a705fce
Commit
0a705fce
authored
May 22, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_simulation: use Base_redirect and translate messages
parent
c173fd6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/DeliveryModule_mergeDeliveryList.py
...skins/erp5_simulation/DeliveryModule_mergeDeliveryList.py
+6
-6
No files found.
bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/DeliveryModule_mergeDeliveryList.py
View file @
0a705fce
...
@@ -5,15 +5,15 @@ delivery_list = []
...
@@ -5,15 +5,15 @@ delivery_list = []
for
o
in
object_list
:
for
o
in
object_list
:
delivery_list
.
append
(
o
)
delivery_list
.
append
(
o
)
Base_translateString
=
context
.
Base_translateString
if
len
(
delivery_list
)
<
2
:
if
len
(
delivery_list
)
<
2
:
ret_url
=
context
.
absolute_url
()
+
'/'
+
form_id
message
=
Base_translateString
(
'Please select more than one items.'
)
qs
=
'?portal_status_message=Please+select+more+than+one+items.'
else
:
else
:
ret_url
=
context
.
absolute_url
()
+
'/'
+
form_id
error_list
=
context
.
portal_simulation
.
mergeDeliveryList
(
delivery_list
)
error_list
=
context
.
portal_simulation
.
mergeDeliveryList
(
delivery_list
)
if
not
error_list
:
if
not
error_list
:
qs
=
'?portal_status_message=Merged.'
message
=
Base_translateString
(
'Merged.'
)
else
:
else
:
qs
=
'?portal_status_message=%s'
%
(
' '
.
join
(
error_list
)
)
message
=
' '
.
join
([
str
(
x
)
for
x
in
error_list
]
)
return
REQUEST
.
RESPONSE
.
redirect
(
ret_url
+
qs
)
return
context
.
Base_redirect
(
'view'
,
keep_items
=
{
'portal_status_message'
:
message
}
)
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