Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
6f66bae9
Commit
6f66bae9
authored
Mar 14, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PreferenceTool: do not return the default _marker
parent
db834045
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
product/ERP5Form/PreferenceTool.py
product/ERP5Form/PreferenceTool.py
+2
-0
product/ERP5Form/tests/testPreferences.py
product/ERP5Form/tests/testPreferences.py
+1
-0
No files found.
product/ERP5Form/PreferenceTool.py
View file @
6f66bae9
...
@@ -130,6 +130,8 @@ class PreferenceTool(BaseTool):
...
@@ -130,6 +130,8 @@ class PreferenceTool(BaseTool):
method
=
getattr
(
self
,
'get%s'
%
convertToUpperCase
(
pref_name
),
None
)
method
=
getattr
(
self
,
'get%s'
%
convertToUpperCase
(
pref_name
),
None
)
if
method
is
not
None
:
if
method
is
not
None
:
return
method
(
default
)
return
method
(
default
)
if
default
is
_marker
:
return
None
return
default
return
default
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
"setPreference"
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
"setPreference"
)
...
...
product/ERP5Form/tests/testPreferences.py
View file @
6f66bae9
...
@@ -225,6 +225,7 @@ class TestPreferences(PropertySheetTestCase):
...
@@ -225,6 +225,7 @@ class TestPreferences(PropertySheetTestCase):
'preferred_accounting_transaction_simulation_state_list'
)),
'preferred_accounting_transaction_simulation_state_list'
)),
list
(
group
.
getPreferredAccountingTransactionSimulationStateList
()))
list
(
group
.
getPreferredAccountingTransactionSimulationStateList
()))
self
.
assertEqual
(
None
,
pref_tool
.
getPreference
(
'this_does_not_exists'
))
self
.
assertEqual
(
'default'
,
pref_tool
.
getPreference
(
self
.
assertEqual
(
'default'
,
pref_tool
.
getPreference
(
'this_does_not_exists'
,
'default'
))
'this_does_not_exists'
,
'default'
))
...
...
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