71 properties = {} |
71 properties = {} |
72 properties['partial_path'] = partial_path |
72 properties['partial_path'] = partial_path |
73 properties['link_name'] = link_name |
73 properties['link_name'] = link_name |
74 properties['title'] = form.cleaned_data.get('title') |
74 properties['title'] = form.cleaned_data.get('title') |
75 properties['short_name'] = form.cleaned_data.get('short_name') |
75 properties['short_name'] = form.cleaned_data.get('short_name') |
76 properties['abstract'] = form.cleaned_data.get('abstract') |
|
77 properties['content'] = form.cleaned_data.get('content') |
76 properties['content'] = form.cleaned_data.get('content') |
78 properties['author'] = models.user.logic.getFromFields(email=email) |
77 properties['author'] = models.user.logic.getFromFields(email=email) |
79 properties['is_featured'] = form.cleaned_data.get('is_featured') |
78 properties['is_featured'] = form.cleaned_data.get('is_featured') |
80 |
79 |
81 doc = document.logic.updateOrCreateFromFields(properties, |
80 doc = document.logic.updateOrCreateFromFields(properties, |
242 # populate form with the existing Document entity |
241 # populate form with the existing Document entity |
243 author_link_name = doc.author.link_name |
242 author_link_name = doc.author.link_name |
244 form = EditForm(initial={'doc_key_name': doc.key().name(), |
243 form = EditForm(initial={'doc_key_name': doc.key().name(), |
245 'title': doc.title, 'partial_path': doc.partial_path, |
244 'title': doc.title, 'partial_path': doc.partial_path, |
246 'link_name': doc.link_name, 'short_name': doc.short_name, |
245 'link_name': doc.link_name, 'short_name': doc.short_name, |
247 'abstract': doc.abstract, 'content': doc.content, |
246 'content': doc.content, 'author': doc.author, |
248 'author': doc.author, 'is_featured': doc.is_featured, |
247 'is_featured': doc.is_featured, 'created_by': author_link_name}) |
249 'created_by': author_link_name}) |
|
250 else: |
248 else: |
251 if request.GET.get(profile.SUBMIT_MSG_PARAM_NAME): |
249 if request.GET.get(profile.SUBMIT_MSG_PARAM_NAME): |
252 # redirect to aggressively remove 'Profile saved' query parameter |
250 # redirect to aggressively remove 'Profile saved' query parameter |
253 return http.HttpResponseRedirect(request.path) |
251 return http.HttpResponseRedirect(request.path) |
254 |
252 |