equal
deleted
inserted
replaced
204 doc = document.logic.getFromFields(partial_path=partial_path, |
204 doc = document.logic.getFromFields(partial_path=partial_path, |
205 link_name=link_name) |
205 link_name=link_name) |
206 except out_of_band.ErrorResponse, error: |
206 except out_of_band.ErrorResponse, error: |
207 # show custom 404 page when path doesn't exist in Datastore |
207 # show custom 404 page when path doesn't exist in Datastore |
208 error.message = error.message + DEF_CREATE_NEW_DOC_MSG |
208 error.message = error.message + DEF_CREATE_NEW_DOC_MSG |
209 return simple.errorResponse(request, error, template, context, page) |
209 return simple.errorResponse(request, page, error, template, context) |
210 |
210 |
211 if request.method == 'POST': |
211 if request.method == 'POST': |
212 form = EditForm(request.POST) |
212 form = EditForm(request.POST) |
213 |
213 |
214 if form.is_valid(): |
214 if form.is_valid(): |
308 existing_doc = document.logic.getFromFields(partial_path=partial_path, |
308 existing_doc = document.logic.getFromFields(partial_path=partial_path, |
309 link_name=link_name) |
309 link_name=link_name) |
310 except out_of_band.ErrorResponse, error: |
310 except out_of_band.ErrorResponse, error: |
311 # show custom 404 page when path doesn't exist in Datastore |
311 # show custom 404 page when path doesn't exist in Datastore |
312 error.message = error.message + DEF_CREATE_NEW_DOC_MSG |
312 error.message = error.message + DEF_CREATE_NEW_DOC_MSG |
313 return simple.errorResponse(request, error, template, context, page) |
313 return simple.errorResponse(request, page, error, template, context) |
314 |
314 |
315 if existing_doc: |
315 if existing_doc: |
316 document.logic.delete(existing_doc) |
316 document.logic.delete(existing_doc) |
317 |
317 |
318 return http.HttpResponseRedirect('/site/docs/list') |
318 return http.HttpResponseRedirect('/site/docs/list') |