Removed workflow property from Program model.
authorLennard de Rijk <ljvderijk@gmail.com>
Wed, 26 Aug 2009 18:45:01 +0200
changeset 2813 6f7af233b5b0
parent 2812 9280179e34fd
child 2814 864a6cd27d20
Removed workflow property from Program model. This has become obsolete with the new Module approach. Also fixed a small error I made when reviewing Madhusudan's timeline patch in _editPost for Program View.
app/soc/models/program.py
app/soc/models/seed_db.py
app/soc/views/models/program.py
--- a/app/soc/models/program.py	Wed Aug 26 18:37:35 2009 +0200
+++ b/app/soc/models/program.py	Wed Aug 26 18:45:01 2009 +0200
@@ -130,14 +130,6 @@
       'Date as of which the student minimum age requirement '
       'should be reached.')
 
-  #: Required field storing the type of workflow this program has
-  workflow = db.StringProperty(required=True,
-      choices=['gsoc', 'ghop'],
-      verbose_name= ugettext('Workflow type'))
-  workflow.example_text = ugettext(
-      '<tt><b>Project-based</b> for GSoC workflow type,<br>' 
-      '<b>Task-based</b> for GHOP workflow type.</tt>')
-
   #: Required 1:1 relationship indicating the Program the Timeline
   #: belongs to.
   timeline = db.ReferenceProperty(reference_class=soc.models.timeline.Timeline,
--- a/app/soc/models/seed_db.py	Wed Aug 26 18:37:35 2009 +0200
+++ b/app/soc/models/seed_db.py	Wed Aug 26 18:45:01 2009 +0200
@@ -335,7 +335,6 @@
       'description': 'This is the program for GSoC 2009.',
       'apps_tasks_limit': 42,
       'slots': 42,
-      'workflow': 'gsoc',
       'timeline': gsoc2009_timeline,
       'status': 'visible',
       }
@@ -343,7 +342,7 @@
   gsoc2009 = Program(**program_properties)
   gsoc2009.put()
 
-
+  # TODO: Use real GHOPProgram here
   timeline_properties = {
         'key_name': 'google/ghop2009',
         'link_id': 'ghop2009',
@@ -362,7 +361,6 @@
       'short_name': 'GHOP 2009',
       'group_label': 'GHOP',
       'description': 'This is the program for GHOP 2009.',
-      'workflow': 'ghop',
       'timeline': ghop2009_timeline,
       })
 
--- a/app/soc/views/models/program.py	Wed Aug 26 18:37:35 2009 +0200
+++ b/app/soc/views/models/program.py	Wed Aug 26 18:45:01 2009 +0200
@@ -158,8 +158,6 @@
         'accepted_orgs_msg': forms.fields.CharField(
             widget=helper.widgets.TinyMCE(attrs={'rows':10, 'cols':40})),
         'scope_path': forms.CharField(widget=forms.HiddenInput, required=True),
-        'workflow': forms.ChoiceField(choices=[('gsoc','Project-based'),
-            ('ghop','Task-based')], required=True),
         }
 
     reference_fields = [
@@ -181,8 +179,6 @@
           filter_fields={'prefix': new_params['document_prefix']},
           required=False, label=label, help_text=help_text)
 
-    result['workflow'] = forms.CharField(widget=widgets.ReadOnlyInput(),
-                                         required=True)
     result['clean'] = cleaning.clean_refs(new_params,
                                           [i for i,_,_ in reference_fields])
 
@@ -587,7 +583,7 @@
 
     super(View, self)._editPost(request, entity, fields)
 
-    if entity:
+    if not entity:
       # there is no existing entity so create a new timeline
       fields['timeline'] = self._params['logic'].createTimelineForType(fields)
     else: