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
660662f4
Commit
660662f4
authored
Apr 26, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Folder: do not silently ignore non existant id generator
parent
905e20d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
product/ERP5Type/Core/Folder.py
product/ERP5Type/Core/Folder.py
+1
-2
product/ERP5Type/tests/testFolder.py
product/ERP5Type/tests/testFolder.py
+6
-1
No files found.
product/ERP5Type/Core/Folder.py
View file @
660662f4
...
@@ -256,7 +256,6 @@ class FolderMixIn(ExtensionClass.Base):
...
@@ -256,7 +256,6 @@ class FolderMixIn(ExtensionClass.Base):
Permission is view because we may want to add content to a folder
Permission is view because we may want to add content to a folder
without changing the folder content itself.
without changing the folder content itself.
XXX
"""
"""
my_id
=
None
my_id
=
None
if
id_group
is
None
:
if
id_group
is
None
:
...
@@ -273,7 +272,7 @@ class FolderMixIn(ExtensionClass.Base):
...
@@ -273,7 +272,7 @@ class FolderMixIn(ExtensionClass.Base):
# default value of id_generator and force safe fallback in this case.
# default value of id_generator and force safe fallback in this case.
idGenerator
=
getattr
(
self
,
id_generator
,
None
)
idGenerator
=
getattr
(
self
,
id_generator
,
None
)
if
idGenerator
is
None
:
if
idGenerator
is
None
:
idGenerator
=
self
.
_generateNextId
raise
ValueError
(
"Could not find id_generator %r"
%
(
id_generator
,))
else
:
else
:
idGenerator
=
self
.
_generateNextId
idGenerator
=
self
.
_generateNextId
my_id
=
idGenerator
()
my_id
=
idGenerator
()
...
...
product/ERP5Type/tests/testFolder.py
View file @
660662f4
...
@@ -112,6 +112,11 @@ class TestFolder(ERP5TypeTestCase, LogInterceptor):
...
@@ -112,6 +112,11 @@ class TestFolder(ERP5TypeTestCase, LogInterceptor):
obj
=
self
.
newContent
()
obj
=
self
.
newContent
()
self
.
assertEquals
(
obj
.
getId
(),
id_generator_id_list
[
expected_length
])
self
.
assertEquals
(
obj
.
getId
(),
id_generator_id_list
[
expected_length
])
def
test_03_unkownGenerateNewId
(
self
):
self
.
folder
.
setIdGenerator
(
'no such method'
)
self
.
assertRaises
(
ValueError
,
self
.
folder
.
generateNewId
)
self
.
assertRaises
(
ValueError
,
self
.
folder
.
newContent
)
def
_setAllowedContentTypesForFolderType
(
self
,
allowed_content_type_list
):
def
_setAllowedContentTypesForFolderType
(
self
,
allowed_content_type_list
):
"""Set allowed content types for Folder portal type."""
"""Set allowed content types for Folder portal type."""
self
.
getTypesTool
().
Folder
.
edit
(
self
.
getTypesTool
().
Folder
.
edit
(
...
...
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