app/soc/views/models/student_proposal.py
changeset 2285 76707dc77b33
parent 2260 129901892999
child 2360 e389d26949db
--- a/app/soc/views/models/student_proposal.py	Wed Apr 29 18:51:58 2009 +0200
+++ b/app/soc/views/models/student_proposal.py	Wed Apr 29 22:24:14 2009 +0200
@@ -485,18 +485,13 @@
       org_entity = org_logic.logic.getForFields(filter, unique=True)
 
       if org_entity:
-        # organization found use special form
+        # organization found use special form and also seed this form
         params['create_form'] = params['student_create_form']
+        kwargs['organization'] = org_entity.link_id
         kwargs['content'] = org_entity.contrib_template
 
-    # Create page is an edit page with no key fields
-    empty_kwargs = {}
-    fields = self._logic.getKeyFieldNames()
-    for field in fields:
-      empty_kwargs[field] = None
-
-    return super(View, self).edit(request, access_type, page_name=page_name,
-                     params=params, seed=kwargs, **empty_kwargs)
+    return super(View, self).create(request, access_type, page_name=page_name,
+                     params=params, **kwargs)
 
   @decorators.merge_params
   @decorators.check_access
@@ -518,7 +513,7 @@
       proposal_logic = params['logic']
       student_proposal_entity = proposal_logic.getForFields(filter, unique=True)
       reviewer = student_proposal_entity.scope
-      
+
       # update the entity mark it as invalid
       proposal_logic.updateEntityProperties(student_proposal_entity,
           {'status': 'invalid'})
@@ -526,7 +521,7 @@
       # redirect to the program's homepage
       redirect_url = redirects.getHomeRedirect(student_proposal_entity.program,
           {'url_name': 'program'})
-      
+
       comment = "Student withdrew proposal."
       self._createReviewFor(student_proposal_entity, reviewer, comment)
       return http.HttpResponseRedirect(redirect_url)