Commit 5b8778ae authored by Yusei Tahara's avatar Yusei Tahara

Fix MovementHistoryListBrain constructor. start_date or stop_date may be None.

parent 42a9f6ed
...@@ -377,10 +377,16 @@ class MovementHistoryListBrain(InventoryListBrain): ...@@ -377,10 +377,16 @@ class MovementHistoryListBrain(InventoryListBrain):
# the brain is accessed from the Shared.DC.ZRDB.Results.Results instance # the brain is accessed from the Shared.DC.ZRDB.Results.Results instance
obj = self.getObject() obj = self.getObject()
if obj is not None: if obj is not None:
timezone = None
if self.node_relative_url == obj.getSource(): if self.node_relative_url == obj.getSource():
timezone = obj.getStartDate().timezone() start_date = obj.getStartDate()
if start_date is not None:
timezone = start_date.timezone()
else: else:
timezone = obj.getStopDate().timezone() stop_date = obj.getStopDate()
if stop_date is not None:
timezone = stop_date.timezone()
if timezone is not None:
self.date = self.date.toZone(timezone) self.date = self.date.toZone(timezone)
def _debit(self): def _debit(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