equal
deleted
inserted
replaced
101 properties['abstract'] = form.cleaned_data.get('abstract') |
101 properties['abstract'] = form.cleaned_data.get('abstract') |
102 properties['content'] = form.cleaned_data.get('content') |
102 properties['content'] = form.cleaned_data.get('content') |
103 properties['user'] = models.user.logic.getFromFields(email=email) |
103 properties['user'] = models.user.logic.getFromFields(email=email) |
104 |
104 |
105 doc = document.logic.updateOrCreateFromFields(properties, |
105 doc = document.logic.updateOrCreateFromFields(properties, |
106 partial_path=partial_path, link_name=link_name) |
106 partial_path=partial_path, |
107 |
107 link_name=link_name) |
108 return doc |
108 return doc |
109 |
109 |
110 |
110 |
111 def edit(request, partial_path=None, link_name=None, |
111 def edit(request, partial_path=None, link_name=None, |
112 template=DEF_SITE_DOCS_EDIT_TMPL): |
112 template=DEF_SITE_DOCS_EDIT_TMPL): |
141 |
141 |
142 # try to fetch Document entity corresponding to path if one exists |
142 # try to fetch Document entity corresponding to path if one exists |
143 try: |
143 try: |
144 if path: |
144 if path: |
145 doc = document.logic.getFromFields(partial_path=partial_path, |
145 doc = document.logic.getFromFields(partial_path=partial_path, |
146 link_name=link_name) |
146 link_name=link_name) |
147 except out_of_band.ErrorResponse, error: |
147 except out_of_band.ErrorResponse, error: |
148 # show custom 404 page when path doesn't exist in Datastore |
148 # show custom 404 page when path doesn't exist in Datastore |
149 error.message = error.message + DEF_CREATE_NEW_DOC_MSG |
149 error.message = error.message + DEF_CREATE_NEW_DOC_MSG |
150 return simple.errorResponse(request, error, template, context) |
150 return simple.errorResponse(request, error, template, context) |
151 |
151 |