# HG changeset patch # User Sylvain Thénault # Date 1265806649 -3600 # Node ID 9b7b3303c515d3c7d501d92ceda4ce0ec5cc3978 # Parent d92aa3221c30e718208bbfd6cd2e92dd2232f1d6 fix match_transition selector: for instance w/ forge version change state form overiding, we want the form with the publication_date selected by the editcontroller, whatever the transition diff -r d92aa3221c30 -r 9b7b3303c515 selectors.py --- a/selectors.py Wed Feb 10 12:00:37 2010 +0100 +++ b/selectors.py Wed Feb 10 13:57:29 2010 +0100 @@ -1062,13 +1062,19 @@ class match_transition(ExpectedValueSelector): - """Return 1 if a `transition` argument is found in the input context which - has a `.name` attribute matching one of the expected names given to the - initializer. + """Return 1 if: + + * a `transition` argument is found in the input context which + has a `.name` attribute matching one of the expected names given to the + initializer + + * no transition specified. """ @lltrace def __call__(self, cls, req, transition=None, **kwargs): # XXX check this is a transition that apply to the object? + if transition is None: + return 1 if transition is not None and getattr(transition, 'name', None) in self.expected: return 1 return 0