diff -r 850d9a5ad894 -r be0de865ffc9 app/soc/views/models/user.py
--- a/app/soc/views/models/user.py Sat Nov 22 08:55:55 2008 +0000
+++ b/app/soc/views/models/user.py Sat Nov 22 09:08:29 2008 +0000
@@ -143,6 +143,16 @@
"""View methods for the User model.
"""
+ DEF_USER_ACCOUNT_INVALID_MSG_FMT = ugettext_lazy(
+ 'The %(email)s account cannot be used with this site, for'
+ ' one or more of the following reasons:'
+ '
'
+ ' - the account is invalid
'
+ ' - the account is already attached to a User profile and cannot be'
+ ' used to create another one
'
+ ' - the account is a former account that cannot be used again
'
+ '
')
+
def __init__(self, original_params=None):
"""Defines the fields and methods required for the base View class
to provide the user with list, public, create, edit and delete views.
@@ -235,8 +245,11 @@
# check if user account is not in former_accounts
# if it is show error message that account is invalid
if soc.logic.models.user.logic.isFormerAccount(account):
- error = out_of_band.Error(DEF_USER_ACCOUNT_INVALID_MSG)
- return error.response(request, template=template, context=context)
+ msg = self.DEF_USER_ACCOUNT_INVALID_MSG_FMT % {
+ 'email': account.email()}
+ error = out_of_band.Error(msg)
+ return error.response(request, template=self.EDIT_SELF_TMPL,
+ context=context)
user = soc.logic.models.user.logic.updateOrCreateFromFields(
properties, {'link_id': new_link_id})