app/soc/views/models/program.py
changeset 770 eb2e69312953
parent 769 a0ee643fe832
child 771 0b1beae179f5
equal deleted inserted replaced
769:a0ee643fe832 770:eb2e69312953
    87   
    87   
    88   def _editPost(self, request, entity, fields):
    88   def _editPost(self, request, entity, fields):
    89     """See base._editPost().
    89     """See base._editPost().
    90     """
    90     """
    91     
    91     
    92     fields['timeline'] = self._createTimelineForType(fields['workflow'])
    92     if not entity:
       
    93       # there is no existing entity so create a new timeline
       
    94       fields['timeline'] = self._createTimelineForType(fields['workflow'])
       
    95     else:
       
    96       # use the timeline from the entity
       
    97       fields['timeline'] = entity.timeline
    93     
    98     
    94   def _createTimelineForType(self, type):
    99   def _createTimelineForType(self, type):
    95     """Creates and stores a timeline model for the given type of program
   100     """Creates and stores a timeline model for the given type of program
    96     """
   101     """
    97     
   102