Commit 6a2ea60a authored by Vladimir Popescu's avatar Vladimir Popescu
Browse files

[views] Use new RegisterUserService instead of the register_user method

Closes #3020639.
parent b958f4fa3904
......@@ -33,7 +33,7 @@ class RegistrationForm(forms.FieldsForm):
return self._cw.build_url(u'registration_sendmail')
# properly name fields according to validation errors that may be raised by
# Repository.register_user
# the register_user service
login = ff.StringField(widget=fw.TextInput(), role='subject',
# we don't want to see 'authenticate'
label=_('i18n_register_login'),
......@@ -139,10 +139,13 @@ class RegistrationConfirmController(controller.Controller):
req.form = data # hijack for proper validation error handling
err_raised = False
try:
self.appli.repo.register_user(login, password,
email=data.get(qname('email_address')),
firstname=data.get(qname('firstname')),
surname=data.get(qname('surname')))
with self.appli.repo.internal_cnx() as cnx:
cnx.call_service('register_user',
login=login, password=password,
email=data.get(qname('email_address')),
firstname=data.get(qname('firstname')),
surname=data.get(qname('surname')))
cnx.commit()
except ValidationError, err:
err_raised = True
# XXX TEMPORARY HACK to allow registration links to work more than
......
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