Commit 7182ff64 authored by wenjie.zheng's avatar wenjie.zheng

Worklist.py: when generating guard, create an empty guard first.

parent daef2633
......@@ -87,10 +87,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
def generateGuard(self):
if self.guard == None:
self.guard = Guard(permissions=self.getPermissionList(),
roles=self.getRoleList(),
groups=self.getGroupList(),
expr=Expression(self.getExpression()))
self.guard = Guard()
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.getPermissionList() is not None:
......@@ -170,7 +167,7 @@ class Worklist(IdAsReferenceMixin("worklist_", "prefix"), XMLObject):
LOG(" ***** props in worklist is '%s'"%props, 0, 0)
for k in props:
# in new worklist, use properties to set value.
v = props.get(k)
v = props.get(k, '')
if v:
if k == 'guard_expr':
self.setExpression(v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment