Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from rdikeshwar/master
Browse files Browse the repository at this point in the history
Script for uninstalling the ssc_hook
  • Loading branch information
tseaver committed Dec 10, 2015
2 parents 112c193 + 64d90cc commit 5f3d40d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions zope2/sessioncookie/scripts/uninstall.py
@@ -0,0 +1,26 @@
# Script to be run via 'zopectl run'.
#
# Uninstalls the SSC as a '_before_traverse_' hook, and enables
# the default '/session_data_manager'.
#

import transaction
from ZPublisher.BeforeTraverse import unregisterBeforeTraverse

from zope2.sessioncookie import ssc_hook


def main(root):
sdm = root._getOb('session_data_manager', None)
if sdm is not None:
sdm.updateTraversalData(requestSessionName='SESSION')

unregisterBeforeTraverse(root, 'sessioncookie')
root.sessioncookie_installed = False

print('zope2.sessioncookie hook uninstalled!')
transaction.commit()


if __name__ == '__main__':
main(root=app)

0 comments on commit 5f3d40d

Please sign in to comment.