[CMF-checkins] CVS: CMF/CMFCollector/skins/collector - collector_issue_edit.py:1.5
Ken Manheimer
klm@zope.com
Sat, 27 Oct 2001 23:56:29 -0400
Update of /cvs-repository/CMF/CMFCollector/skins/collector
In directory cvs.zope.org:/tmp/cvs-serv28466
Modified Files:
collector_issue_edit.py
Log Message:
Correct the action choice when security_related is toggled - we need
to choose whether we're restricting or unrestricting according to how
security_related is being toggled, and then cycle through the
available actions to pick the right available one (if any).
=== CMF/CMFCollector/skins/collector/collector_issue_edit.py 1.4 => 1.5 ===
if context.security_related != was_security_related:
- # Do first available restrict/unrestrict action:
+ # We're toggling security_related - we have to do the corresponding
+ # restrict/unrestrict if available in the current state:
+ if context.security_related:
+ seeking_pretty = 'Restrict'
+ else:
+ seeking_pretty = 'Unrestrict'
for action, pretty in context.valid_actions_pairs():
- if pretty in ['Restrict', 'Unrestrict']:
+ if pretty == seeking_pretty:
context.do_action(action, ' Triggered by security_related toggle.')
changed = changed + ", " + pretty.lower() + 'ed'
break