Commit 17d82d58 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

backport stable

......@@ -16,3 +16,5 @@ ade2c366ddf2ce503d868d2cb1bd43b060afa365 cubicweb-registration-debian-version-0.
b57032accd10ae5fc7c47c24a989993b6bfb3dfd cubicweb-registration-debian-version-0.4.0-1
bb2da03b39d3086c665fb7c1345aee397f7b6328 cubicweb-registration-version-0.4.1
988cd7f32430c428f610bdd56ec92f23a0b02416 cubicweb-registration-debian-version-0.4.1-1
be9928c1932f031d41dd9615306a599ac7de01cd cubicweb-registration-version-0.4.2
a45c6e15d817fc0ffb5107e789753618c3af2201 cubicweb-registration-debian-version-0.4.2-1
......@@ -4,7 +4,7 @@
modname = 'registration'
distname = 'cubicweb-registration'
numversion = (0, 4, 1)
numversion = (0, 4, 2)
version = '.'.join(str(num) for num in numversion)
license = 'LGPL'
......
cubicweb-registration (0.4.2-1) unstable; urgency=low
* new upstream release
-- Nicolas Chauvat <nicolas.chauvat@logilab.fr> Mon, 16 May 2011 16:04:19 +0200
cubicweb-registration (0.4.1-1) unstable; urgency=low
* new upstream release
......
File mode changed from 100644 to 100755
......@@ -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"
......
#!/usr/bin/env python
# pylint: disable=W0404,W0622,W0704,W0613
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
__docformat__ = "restructuredtext en"
......
......@@ -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)
......@@ -163,9 +163,9 @@ class RegistrationTC(CubicWebTC):
self._check_user_not_created()
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.create_user(self.request(), 'test')
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'
......
"""anonymous registration form and views
:organization: Logilab / SecondWeb
:copyright: 2009-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:copyright: 2009-2011 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
"""
......@@ -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