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

View file

@ -1281,6 +1281,7 @@ en:
change_password_title: TRACKS::Change password
choose_password: Choose password
confirm_password: Confirm password
create_error: User creation failed, maybe you already have an account here?
desired_login: Desired login
destroy_confirmation: 'Warning: this will delete user ''%{login}'', all their
actions, contexts, project and notes. Are you sure that you want to continue?'
@ -1315,6 +1316,7 @@ en:
signup_successful: Signup successful for user %{username}.
successfully_deleted_user: Successfully deleted user %{username}
tos_link: read the Terms of Service
tos_error: You have to accept the terms of service to sign up!
total_actions: Total actions
total_contexts: Total contexts
total_notes: Total notes