Change name of getUserFromLinkNameOrDie function to getUserFromLinkNameOr404 and apply changes to affected files.
Patch by: Pawel Solyga
Review by: to-be-reviewed
--- a/app/soc/logic/site/id_user.py Thu Oct 16 13:14:13 2008 +0000
+++ b/app/soc/logic/site/id_user.py Thu Oct 16 13:16:46 2008 +0000
@@ -141,7 +141,7 @@
return soc.models.user.User.gql('WHERE link_name = :1', link_name).get()
-def getUserFromLinkNameOrDie(link_name):
+def getUserFromLinkNameOr404(link_name):
"""Like getUserFromLinkName but expects to find a user
Raises:
--- a/app/soc/views/simple.py Thu Oct 16 13:14:13 2008 +0000
+++ b/app/soc/views/simple.py Thu Oct 16 13:16:46 2008 +0000
@@ -60,7 +60,7 @@
try:
if link_name:
- user = id_user.getUserFromLinkNameOrDie(link_name)
+ user = id_user.getUserFromLinkNameOr404(link_name)
except out_of_band.ErrorResponse, error:
return errorResponse(request, error, template, context)
--- a/app/soc/views/site/user/profile.py Thu Oct 16 13:14:13 2008 +0000
+++ b/app/soc/views/site/user/profile.py Thu Oct 16 13:16:46 2008 +0000
@@ -275,7 +275,7 @@
# try to fetch User entity corresponding to link_name if one exists
try:
if link_name:
- user = id_user.getUserFromLinkNameOrDie(link_name)
+ user = id_user.getUserFromLinkNameOr404(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
--- a/app/soc/views/user/profile.py Thu Oct 16 13:14:13 2008 +0000
+++ b/app/soc/views/user/profile.py Thu Oct 16 13:16:46 2008 +0000
@@ -117,7 +117,7 @@
# try to fetch User entity corresponding to link_name if one exists
try:
if link_name:
- link_name_user = id_user.getUserFromLinkNameOrDie(link_name)
+ link_name_user = id_user.getUserFromLinkNameOr404(link_name)
except out_of_band.ErrorResponse, error:
# show custom 404 page when link name doesn't exist in Datastore
return simple.errorResponse(request, error, template, context)