Fix a few user creation errors to be prettier

This commit is contained in:
Jyri-Petteri Paloposki 2024-07-18 22:34:04 +03:00
parent 7b9a1e322f
commit 2bf2f9476a
2 changed files with 5 additions and 1 deletions

View file

@ -81,13 +81,15 @@ class UsersController < ApplicationController
end
unless params['approve_tos'] == 'on' || SITE_CONFIG['tos_link'].blank?
render_failure "You have to accept the terms of service to sign up!"
notify :error, t('users.tos_error')
redirect_to signup_path
return
end
user = User.new(user_params)
unless user.valid?
notify :error, t('users.create_error')
redirect_to signup_path
return
end