[gen] Bugfixes.
This commit is contained in:
parent
98b748cfb1
commit
8511bcd675
|
@ -921,8 +921,11 @@ class Ref(Field):
|
||||||
# It is a tuple ('sort', method). Perform a full sort.
|
# It is a tuple ('sort', method). Perform a full sort.
|
||||||
refs.append(uid)
|
refs.append(uid)
|
||||||
tool = zobj.getTool()
|
tool = zobj.getTool()
|
||||||
refs.sort(key=lambda uid:self.insert[1](obj, \
|
# Warning: "refs" is a persistent list whose method "sort" has no
|
||||||
|
# param "key".
|
||||||
|
refs.data.sort(key=lambda uid:self.insert[1](obj, \
|
||||||
tool.getObject(uid, appy=True)))
|
tool.getObject(uid, appy=True)))
|
||||||
|
refs._p_changed = 1
|
||||||
# Update the back reference
|
# Update the back reference
|
||||||
if not back: self.back.linkObject(value, obj, back=True)
|
if not back: self.back.linkObject(value, obj, back=True)
|
||||||
|
|
||||||
|
|
|
@ -322,7 +322,7 @@ class Transition:
|
||||||
# Condition is a role. Transition may be triggered if the user has
|
# Condition is a role. Transition may be triggered if the user has
|
||||||
# this role.
|
# this role.
|
||||||
return user.has_role(self.condition.name, obj)
|
return user.has_role(self.condition.name, obj)
|
||||||
elif type(self.condition) == types.FunctionType:
|
elif callable(self.condition):
|
||||||
return self.condition(wf, obj.appy())
|
return self.condition(wf, obj.appy())
|
||||||
elif type(self.condition) in (tuple, list):
|
elif type(self.condition) in (tuple, list):
|
||||||
# It is a list of roles and/or functions. Transition may be
|
# It is a list of roles and/or functions. Transition may be
|
||||||
|
|
Loading…
Reference in a new issue