Show More
@@ -197,7 +197,7 b' class LoginView(object):' | |||
|
197 | 197 | @view_config( |
|
198 | 198 | route_name='register', request_method='GET', |
|
199 | 199 | renderer='rhodecode:templates/register.html',) |
|
200 | def register(self): | |
|
200 | def register(self, defaults={}, errors={}): | |
|
201 | 201 | settings = SettingsModel().get_all_settings() |
|
202 | 202 | captcha_public_key = settings.get('rhodecode_captcha_public_key') |
|
203 | 203 | captcha_private_key = settings.get('rhodecode_captcha_private_key') |
@@ -208,6 +208,8 b' class LoginView(object):' | |||
|
208 | 208 | |
|
209 | 209 | render_ctx = self._get_template_context() |
|
210 | 210 | render_ctx.update({ |
|
211 | 'defaults': defaults, | |
|
212 | 'errors': errors, | |
|
211 | 213 | 'auto_active': auto_active, |
|
212 | 214 | 'captcha_active': captcha_active, |
|
213 | 215 | 'captcha_public_key': captcha_public_key, |
@@ -219,10 +221,9 b' class LoginView(object):' | |||
|
219 | 221 | route_name='register', request_method='POST', |
|
220 | 222 | renderer='rhodecode:templates/register.html') |
|
221 | 223 | def register_post(self): |
|
222 |
|
|
|
223 |
|
|
|
224 | captcha_private_key = SettingsModel().get_setting_by_name( | |
|
225 | 'rhodecode_captcha_private_key') | |
|
224 | 226 | captcha_active = bool(captcha_private_key) |
|
225 | register_message = settings.get('rhodecode_register_message') or '' | |
|
226 | 227 | auto_active = 'hg.register.auto_activate' in User.get_default_user()\ |
|
227 | 228 | .AuthUser.permissions['global'] |
|
228 | 229 | |
@@ -258,13 +259,8 b' class LoginView(object):' | |||
|
258 | 259 | except formencode.Invalid as errors: |
|
259 | 260 | del errors.value['password'] |
|
260 | 261 | del errors.value['password_confirmation'] |
|
261 | render_ctx = self._get_template_context() | |
|
262 | render_ctx.update({ | |
|
263 | 'errors': errors.error_dict, | |
|
264 | 'defaults': errors.value, | |
|
265 | 'register_message': register_message, | |
|
266 | }) | |
|
267 | return render_ctx | |
|
262 | return self.register( | |
|
263 | defaults=errors.value, errors=errors.error_dict) | |
|
268 | 264 | |
|
269 | 265 | except UserCreationError as e: |
|
270 | 266 | # container auth or other auth functions that create users on |
@@ -272,11 +268,7 b' class LoginView(object):' | |||
|
272 | 268 | # with user creation, explanation should be provided in |
|
273 | 269 | # Exception itself |
|
274 | 270 | self.session.flash(e, queue='error') |
|
275 | render_ctx = self._get_template_context() | |
|
276 | render_ctx.update({ | |
|
277 | 'register_message': register_message, | |
|
278 | }) | |
|
279 | return render_ctx | |
|
271 | return self.register() | |
|
280 | 272 | |
|
281 | 273 | @view_config( |
|
282 | 274 | route_name='reset_password', request_method=('GET', 'POST'), |
General Comments 0
You need to be logged in to leave comments.
Login now