Commit d3e0e70a authored by Vincent Pelletier's avatar Vincent Pelletier

CMFActivity: Fix ActivityRuntimeEnvironment.getPriority when activity was not...

CMFActivity: Fix ActivityRuntimeEnvironment.getPriority when activity was not loaded from an SQL queue.

This happens when activities are being flushed from the ActivityBuffer
directly, without being inserted into and then loaded from the SQL queue.
It is unclear whether there are uses of this pattern besides
testCMFActivity, but it is easy enough to fix.
parent b35ee2f8
...@@ -61,7 +61,11 @@ class ActivityRuntimeEnvironment(object): ...@@ -61,7 +61,11 @@ class ActivityRuntimeEnvironment(object):
def getPriority(self): def getPriority(self):
result = self._priority result = self._priority
if result is None: if result is None:
return self._message.line.priority message = self._message
line = message.line
if line is None:
return message.activity_kw.get('priority', 1)
return line.priority
return result return result
security.declarePublic('edit') security.declarePublic('edit')
......
...@@ -197,6 +197,7 @@ class Message(BaseMessage): ...@@ -197,6 +197,7 @@ class Message(BaseMessage):
traceback = None traceback = None
document_uid = None document_uid = None
is_registered = False is_registered = False
line = None
def __init__( def __init__(
self, self,
......
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