Fixed a bug where a new timeline would get created on every edit of an existing program.
Patch by: Lennard de Rijk
--- a/app/soc/views/models/program.py Tue Jan 06 20:56:48 2009 +0000
+++ b/app/soc/views/models/program.py Tue Jan 06 21:21:09 2009 +0000
@@ -89,7 +89,12 @@
"""See base._editPost().
"""
- fields['timeline'] = self._createTimelineForType(fields['workflow'])
+ if not entity:
+ # there is no existing entity so create a new timeline
+ fields['timeline'] = self._createTimelineForType(fields['workflow'])
+ else:
+ # use the timeline from the entity
+ fields['timeline'] = entity.timeline
def _createTimelineForType(self, type):
"""Creates and stores a timeline model for the given type of program