Commit 65b237ef authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

[views] address renamed to email_address (closes #1679232)

--HG--
branch : stable
parent df21b2c92f3e
......@@ -49,6 +49,9 @@ msgstr "[register] link"
msgid "ctxcomponents_registration.registerlink_description"
msgstr "link proposing to anonymous user to create an account on the site"
msgid "i18n_email_address"
msgstr "email address"
msgid "i18n_register_login"
msgstr "login"
......
......@@ -9,10 +9,10 @@ msgstr ""
"PO-Revision-Date: 2010-05-05 16:39+0200\n"
"Last-Translator: Nicolas Chauvat <nicolas.chauvat@logilab.fr>\n"
"Language-Team: fr <nicolas.chauvat@logilab.fr>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#, fuzzy, python-format
......@@ -70,6 +70,9 @@ msgstr "lien [s'enregistrer]"
msgid "ctxcomponents_registration.registerlink_description"
msgstr "lien proposant aux anonymes de se créer un compte sur le site"
msgid "i18n_email_address"
msgstr "adresse électronique"
msgid "i18n_register_login"
msgstr "identifiant"
......
......@@ -13,7 +13,7 @@ class RegistrationTC(CubicWebTC):
captcha_value = u'captcha value'
data = {'firstname-subject': u'Toto', 'surname-subject': u'Toto',
'address-subject': u'toto@secondweb.fr',
'email_address-subject': u'toto@secondweb.fr',
'login-subject': u'toto',
'upassword-subject': 'toto',
'upassword-subject-confirm': 'toto',
......@@ -122,7 +122,7 @@ class RegistrationTC(CubicWebTC):
self.assertEqual(params, {'__message': u'Congratulations, your registration is complete. Welcome %(firstname-subject)s %(surname-subject)s !' % self.data})
self.restore_connection()
rset = self.execute('Any U WHERE U login %(login)s, U firstname %(firstname)s, '
'U surname %(surname)s, U use_email M, M address %(address)s',
'U surname %(surname)s, U use_email M, M address %(email_address)s',
dict((k.replace('-subject', ''), v)
for k, v in self.data.items()))
self.failUnless(rset.rowcount)
......@@ -164,8 +164,8 @@ class RegistrationTC(CubicWebTC):
def test_confirm_failure_email_already_used(self):
self.create_user('test')
self.execute('INSERT EmailAddress X: U use_email X, X address %(address)s '
'WHERE U login "test"', {'address': self.data['address-subject']})
self.execute('INSERT EmailAddress X: U use_email X, X address %(email_address)s '
'WHERE U login "test"', {'email_address': self.data['email_address-subject']})
self.commit()
req = self._confirm_req()
req.form['__errorurl'] = 'registration'
......
......@@ -40,8 +40,8 @@ class RegistrationForm(forms.FieldsForm):
required=True)
upassword = ff.StringField(widget=fw.PasswordInput(), role='subject',
required=True)
address = ff.StringField(widget=fw.TextInput(), role='subject',
required=True)
email_address = ff.StringField(widget=fw.TextInput(), role='subject',
required=True, label=_('i18n_email_address'))
firstname = ff.StringField(widget=fw.TextInput(), role='subject')
surname = ff.StringField(widget=fw.TextInput(), role='subject')
captcha = ff.StringField(widget=captcha.CaptchaWidget(), required=True,
......@@ -72,7 +72,7 @@ See you soon on %(base_url)s !
def publish(self, rset=None):
data = self.checked_data()
recipient = data[qname('address')]
recipient = data[qname('email_address')]
msg = self.build_email(recipient, data)
self._cw.vreg.config.sendmails([(msg, (recipient,))])
raise Redirect(self.success_redirect_url())
......@@ -140,7 +140,7 @@ class RegistrationConfirmController(controller.Controller):
err_raised = False
try:
self.appli.repo.register_user(login, password,
email=data.get(qname('address')),
email=data.get(qname('email_address')),
firstname=data.get(qname('firstname')),
surname=data.get(qname('surname')))
except ValidationError, err:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment