# HG changeset patch # User Lennard de Rijk # Date 1231276869 0 # Node ID eb2e69312953a2761c8802f88425cf8b7b4832cc # Parent a0ee643fe8324fe328325e53c9c91767459c5896 Fixed a bug where a new timeline would get created on every edit of an existing program. Patch by: Lennard de Rijk diff -r a0ee643fe832 -r eb2e69312953 app/soc/views/models/program.py --- 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