Skip to content

Commit

Permalink
fix(setup): Use new pre/post profile handlers
Browse files Browse the repository at this point in the history
[Per
feedback](#66 (comment)), use
the new (to me) `post_handler` feature provided by `GenericSetup` as it is much better
than littering the import step registry with one-off, profile-specific import steps.
  • Loading branch information
rpatterson committed Feb 25, 2022
1 parent 1e9cd05 commit 22ba99f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
10 changes: 1 addition & 9 deletions src/Products/PlonePAS/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@
description="Change the Zope root `/acl_users` to use a simple cookie login form
instead of HTTP `Basic ...` for authentication."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
<genericsetup:importStep
name="zope-root-auth-cookie"
title="Zope Root Cookie Login"
description="Change the Zope root `/acl_users` to use a simple cookie login form
instead of HTTP `Basic ...` for authentication."
handler=".setuphandlers.set_up_zope_root_cookie_auth">
<depends name="plonepas" />
</genericsetup:importStep>
post_handler=".setuphandlers.set_up_zope_root_cookie_auth" />

</configure>
5 changes: 1 addition & 4 deletions src/Products/PlonePAS/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,7 @@ def set_up_zope_root_cookie_auth(context):
"""
Change the Zope root `/acl_users` to use a simple cookie login form.
"""
# Only run step if a flag file is present, IOW not for every profile
if context.readDataFile("plone-pas-zope-root-cookie.txt") is None:
return
portal = context.getSite()
portal = aq_parent(context)
root = portal.getPhysicalRoot()
root_acl_users = getToolByName(root, "acl_users")

Expand Down

0 comments on commit 22ba99f

Please sign in to comment.