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
Lukas Niegsch
erp5
Commits
38935ab5
Commit
38935ab5
authored
Oct 27, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base: set portal_status_level in error case of dialog actions
parent
cb2a7c63
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
+23
-7
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_changeId.py
.../SkinTemplateItem/portal_skins/erp5_base/Base_changeId.py
+2
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_postQuery.py
...SkinTemplateItem/portal_skins/erp5_base/Base_postQuery.py
+4
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_shiftDefaultCareer.py
...eItem/portal_skins/erp5_base/Person_shiftDefaultCareer.py
+8
-3
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/PreferenceTool_setNewPassword.py
...m/portal_skins/erp5_base/PreferenceTool_setNewPassword.py
+1
-1
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+8
-1
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_changeId.py
View file @
38935ab5
...
@@ -19,4 +19,5 @@ return context.Base_redirect(form_id,
...
@@ -19,4 +19,5 @@ return context.Base_redirect(form_id,
keep_items
=
dict
(
selection_name
=
selection_name
,
keep_items
=
dict
(
selection_name
=
selection_name
,
selection_index
=
selection_index
,
selection_index
=
selection_index
,
cancel_url
=
cancel_url
,
cancel_url
=
cancel_url
,
portal_status_message
=
translateString
(
"Cancelled."
)),)
portal_status_message
=
translateString
(
"Cancelled."
),
portal_status_level
=
'error'
),)
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_postQuery.py
View file @
38935ab5
...
@@ -3,7 +3,10 @@ ptype = context.getPortalType()
...
@@ -3,7 +3,10 @@ ptype = context.getPortalType()
if
not
description
:
if
not
description
:
return
context
.
Base_redirect
(
dialog_id
,
return
context
.
Base_redirect
(
dialog_id
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
"Question can not be empty."
,),
cancel_url
=
cancel_url
))
keep_items
=
dict
(
portal_status_message
=
translateString
(
"Question can not be empty."
,),
portal_status_level
=
'error'
,
cancel_url
=
cancel_url
))
query
=
context
.
Base_newQuery
(
description
=
description
)
query
=
context
.
Base_newQuery
(
description
=
description
)
query_id
=
query
.
getId
()
query_id
=
query
.
getId
()
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_shiftDefaultCareer.py
View file @
38935ab5
...
@@ -13,7 +13,10 @@ if default_career is None:
...
@@ -13,7 +13,10 @@ if default_career is None:
return
context
.
Base_redirect
(
form_id
=
form_id
,
return
context
.
Base_redirect
(
form_id
=
form_id
,
selection_name
=
selection_name
,
selection_name
=
selection_name
,
selection_index
=
selection_index
,
selection_index
=
selection_index
,
keep_items
=
{
'portal_status_message'
:
message
})
keep_items
=
{
'portal_status_message'
:
message
,
'portal_status_level'
:
'error'
,
})
else
:
else
:
# Copy and paste the default career.
# Copy and paste the default career.
# Change IDs
# Change IDs
...
@@ -25,8 +28,10 @@ else:
...
@@ -25,8 +28,10 @@ else:
return
context
.
Base_redirect
(
form_id
=
form_id
,
return
context
.
Base_redirect
(
form_id
=
form_id
,
selection_name
=
selection_name
,
selection_name
=
selection_name
,
selection_index
=
selection_index
,
selection_index
=
selection_index
,
keep_items
=
{
'portal_status_message'
:
message
})
keep_items
=
{
'portal_status_message'
:
message
,
'portal_status_level'
:
'error'
,
})
new_start_date
=
default_career
.
getStopDate
()
new_start_date
=
default_career
.
getStopDate
()
cb_data
=
person
.
manage_copyObjects
(
ids
=
(
new_id
,))
cb_data
=
person
.
manage_copyObjects
(
ids
=
(
new_id
,))
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/PreferenceTool_setNewPassword.py
View file @
38935ab5
...
@@ -14,4 +14,4 @@ else:
...
@@ -14,4 +14,4 @@ else:
context
.
portal_caches
.
clearCache
((
'erp5_content_short'
,))
context
.
portal_caches
.
clearCache
((
'erp5_content_short'
,))
context
.
logout
()
context
.
logout
()
return
context
.
Base_redirect
()
return
context
.
Base_redirect
()
return
context
.
Base_redirect
(
dialog_id
,
keep_items
=
{
'portal_status_message'
:
msg
})
return
context
.
Base_redirect
(
dialog_id
,
keep_items
=
{
'portal_status_message'
:
msg
,
'portal_status_level'
:
'error'
})
product/ERP5Security/tests/testERP5Security.py
View file @
38935ab5
...
@@ -34,6 +34,7 @@ import mock
...
@@ -34,6 +34,7 @@ import mock
import
itertools
import
itertools
import
transaction
import
transaction
import
unittest
import
unittest
import
urlparse
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
...
@@ -584,7 +585,13 @@ class TestPreferences(UserManagementTestCase):
...
@@ -584,7 +585,13 @@ class TestPreferences(UserManagementTestCase):
current_password
=
'bad'
+
password
,
current_password
=
'bad'
+
password
,
new_password
=
new_password
,
new_password
=
new_password
,
)
)
self
.
assertEqual
(
result
,
self
.
portal
.
absolute_url
()
+
'/portal_preferences/PreferenceTool_viewChangePasswordDialog?portal_status_message=Current%20password%20is%20wrong.'
)
parsed_url
=
urlparse
.
urlparse
(
result
)
self
.
assertEqual
(
parsed_url
.
path
.
split
(
'/'
)[
-
2
:],
[
'portal_preferences'
,
'PreferenceTool_viewChangePasswordDialog'
])
self
.
assertEqual
(
urlparse
.
parse_qs
(
parsed_url
.
query
),
{
'portal_status_message'
:
[
'Current password is wrong.'
],
'portal_status_level'
:
[
'error'
]})
self
.
login
()
self
.
login
()
self
.
_assertUserExists
(
login
,
password
)
self
.
_assertUserExists
(
login
,
password
)
...
...
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