Add deleted in r732 (don't know why) functionality that displays custom Error page when linkname in Developer User Profile url doesn't exist (/site/user/profile/<not_existing_linkname>).
Patch by: Pawel Solyga
Review by: to-be-reviewed
--- a/app/soc/views/site/user/profile.py Tue Oct 14 22:20:55 2008 +0000
+++ b/app/soc/views/site/user/profile.py Tue Oct 14 22:35:46 2008 +0000
@@ -273,8 +273,14 @@
user = None # assume that no User entity will be found
# try to fetch User entity corresponding to link_name if one exists
- if link_name:
- user = id_user.getUserFromLinkName(link_name)
+ try:
+ if link_name:
+ user = id_user.getUserFromLinkNameOrDie(link_name)
+ except out_of_band.ErrorResponse, error:
+ # show custom 404 page when link name doesn't exist in Datastore
+ error.message = error.message + DEF_CREATE_NEW_USER_MSG
+ return simple.errorResponse(request, error, template, context)
+
if request.method == 'POST':
form = EditForm(request.POST)