equal
deleted
inserted
replaced
210 except users.UserNotFoundError: |
210 except users.UserNotFoundError: |
211 raise forms.ValidationError('Account not found.') |
211 raise forms.ValidationError('Account not found.') |
212 |
212 |
213 |
213 |
214 DEF_SITE_USER_PROFILE_EDIT_TMPL = 'soc/site/user/profile/edit.html' |
214 DEF_SITE_USER_PROFILE_EDIT_TMPL = 'soc/site/user/profile/edit.html' |
|
215 DEF_CREATE_NEW_USER_MSG = ' You can create a new user by visiting' \ |
|
216 ' <a href="/site/user/profile">Create ' \ |
|
217 'a New User</a> page.' |
215 |
218 |
216 def edit(request, linkname=None, template=DEF_SITE_USER_PROFILE_EDIT_TMPL): |
219 def edit(request, linkname=None, template=DEF_SITE_USER_PROFILE_EDIT_TMPL): |
217 """View for a Developer to modify the properties of a User Model entity. |
220 """View for a Developer to modify the properties of a User Model entity. |
218 |
221 |
219 Args: |
222 Args: |
239 # try to fetch User entity corresponding to linkname if one exists |
242 # try to fetch User entity corresponding to linkname if one exists |
240 try: |
243 try: |
241 user = id_user.getUserIfLinkName(linkname) |
244 user = id_user.getUserIfLinkName(linkname) |
242 except out_of_band.ErrorResponse, error: |
245 except out_of_band.ErrorResponse, error: |
243 # show custom 404 page when link name doesn't exist in Datastore |
246 # show custom 404 page when link name doesn't exist in Datastore |
|
247 error.message = error.message + DEF_CREATE_NEW_USER_MSG |
244 return simple.errorResponse(request, error, template, context) |
248 return simple.errorResponse(request, error, template, context) |
245 |
249 |
246 if request.method == 'POST': |
250 if request.method == 'POST': |
247 form = EditForm(request.POST) |
251 form = EditForm(request.POST) |
248 |
252 |