# HG changeset patch # User Pawel Solyga # Date 1224078840 0 # Node ID 9d5b8880260f0a4af3d0936a3b18264ca81ff3ca # Parent 9c1a6e02ebec661984b64508bcb1c17a7cdc4caf Fix not working docs show view. Document show view wasn't updated when the logic refactor was made. Patch by: Pawel Solyga Review by: to-be-reviewed diff -r 9c1a6e02ebec -r 9d5b8880260f app/soc/views/docs/show.py --- a/app/soc/views/docs/show.py Wed Oct 15 13:51:31 2008 +0000 +++ b/app/soc/views/docs/show.py Wed Oct 15 13:54:00 2008 +0000 @@ -24,10 +24,9 @@ ] -from google.appengine.api import users - -from soc.logic import document from soc.logic import out_of_band +from soc.logic import path_link_name +from soc.logic.models import document from soc.views import helper from soc.views import simple @@ -63,10 +62,17 @@ # TODO: based on the User's Roles, Documents that the User can edit # should display a link to a document edit form + + doc = None # try to fetch User entity corresponding to link_name if one exists + path = path_link_name.combinePath([partial_path, link_name]) + + # try to fetch Document entity corresponding to path if one exists try: - doc = document.getDocumentIfPath(partial_path, link_name=link_name) + if path: + doc = document.logic.getFromFields(partial_path=partial_path, + link_name=link_name) except out_of_band.ErrorResponse, error: # show custom 404 page when Document path doesn't exist in Datastore return simple.errorResponse(request, error, template, context)