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
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
9cd0b8f9
Commit
9cd0b8f9
authored
Nov 09, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_base: set an auto-generated reference in Person_init.
parent
1bad30d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_init.py
...se/SkinTemplateItem/portal_skins/erp5_base/Person_init.py
+9
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_init.xml
...e/SkinTemplateItem/portal_skins/erp5_base/Person_init.xml
+8
-0
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+12
-8
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_init.py
View file @
9cd0b8f9
# this script can be overridden as you wish.
if
not
context
.
hasReference
():
context
.
setReference
(
'P%i'
%
(
context
.
getPortalObject
().
portal_ids
.
generateNewId
(
id_group
=
'Person.reference'
,
id_generator
=
'non_continuous_integer_increasing'
,
),
),
)
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_init.xml
View file @
9cd0b8f9
...
...
@@ -52,6 +52,14 @@
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args, **kw
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
...
...
product/ERP5Security/tests/testERP5Security.py
View file @
9cd0b8f9
...
...
@@ -106,12 +106,11 @@ class TestUserManagement(ERP5TypeTestCase):
stop_date
=
assignment_stop_date
,)
if
open_assignment
:
assignment
.
open
()
if
new_person
.
hasReference
():
login
=
new_person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
new_person
.
getReference
(),
password
=
password
,)
login
.
validate
()
login
=
new_person
.
newContent
(
portal_type
=
'ERP5 Login'
,
reference
=
new_person
.
getReference
(),
password
=
password
,)
login
.
validate
()
if
tic
:
self
.
tic
()
return
new_person
...
...
@@ -368,8 +367,13 @@ class TestUserManagement(ERP5TypeTestCase):
self
.
_assertUserExists
(
'the_user'
,
'secret'
)
def
test_PersonLoginMigration
(
self
):
pers
=
self
.
_makePerson
()
pers
.
setReference
(
'the_user'
)
pers
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
'the_user'
,
)
pers
.
newContent
(
portal_type
=
'Assignment'
,
).
open
()
pers
.
setPassword
(
'secret'
)
self
.
assertEqual
(
len
(
pers
.
objectValues
(
portal_type
=
'ERP5 Login'
)),
0
)
self
.
tic
()
...
...
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