Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
97186004
Commit
97186004
authored
Jun 19, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added automatic inline migration for the root user folder
parent
d2bb4b34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
src/OFS/Application.py
src/OFS/Application.py
+15
-1
src/OFS/userfolder.py
src/OFS/userfolder.py
+5
-0
No files found.
src/OFS/Application.py
View file @
97186004
...
...
@@ -445,13 +445,27 @@ class AppInitializer:
def
install_inituser
(
self
):
app
=
self
.
getApp
()
# Install the initial user.
if
hasattr
(
app
,
'acl_users'
):
users
=
app
.
acl_users
if
hasattr
(
users
,
'_createInitialUser'
):
app
.
acl_users
.
_createInitialUser
()
self
.
commit
(
'Created initial user'
)
users
=
aq_base
(
users
)
migrated
=
getattr
(
users
,
'_ofs_migrated'
,
False
)
if
not
migrated
:
klass
=
users
.
__class__
from
OFS.userfolder
import
UserFolder
if
klass
is
UserFolder
:
# zope.deferredimport does a thourough job, so the class
# looks like it's from the new location already. And we
# don't want to migrate any custom user folders here.
users
.
__class__
=
UserFolder
users
.
_ofs_migrated
=
True
users
.
_p_changed
=
True
app
.
_p_changed
=
True
transaction
.
get
().
note
(
'Migrated user folder'
)
transaction
.
commit
()
def
install_errorlog
(
self
):
app
=
self
.
getApp
()
...
...
src/OFS/userfolder.py
View file @
97186004
...
...
@@ -303,6 +303,11 @@ class UserFolder(accesscontrol_userfolder.UserFolder, BasicUserFolder):
users and binding them to a collection of roles."""
icon
=
'p_/UserFolder'
_ofs_migrated
=
False
def
__init__
(
self
):
super
(
UserFolder
,
self
).
__init__
()
self
.
_ofs_migrated
=
True
def
_createInitialUser
(
self
):
"""
...
...
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