OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix account controller specs
Oliver Güntherfc99f8596a06
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rbindex 6918ea67e5f..c6d903850ec 100644--- a/app/controllers/account_controller.rb+++ b/app/controllers/account_controller.rb@@ -172,7 +172,8 @@ class AccountController < ApplicationControllerenddef handle_expired_token(token)- send_activation_email! Token::Invitation.create!(user: token.user)+ new_token = Token::Invitation.create!(user: token.user)+ UserMailer.user_signed_up(new_token).deliver_laterflash[:warning] = I18n.t :warning_registration_token_expired, email: token.user.mail@@ -337,7 +338,16 @@ class AccountController < ApplicationController@user.password = params[:user][:password]@user.password_confirmation = params[:user][:password_confirmation]- register_user_according_to_setting @user+ call = ::Users::RegisterUserService.new(@user).call++ if call.success?+ flash[:notice] = call.message.presence+ login_user_if_active(call.result)+ else+ flash[:error] = error = call.message+ Rails.logger.error "Registration of user #{@user.login} failed: #{error}"+ onthefly_creation_failed(@user, login: @user.login)+ endendend@@ -454,7 +464,7 @@ class AccountController < ApplicationControllersuccessful_authentication(user)elseaccount_inactive(user, flash_now: false)- redirect_to signin_path+ redirect_to signin_path(back_url: params[:back_url])endend@@ -514,7 +524,7 @@ class AccountController < ApplicationControllerenddef self_registration_disabled- flash[:error] = I18n.t(:error_self_registration_disabled)+ flash[:error] = I18n.t('account.error_self_registration_disabled')redirect_to signin_urlend@@ -544,14 +554,6 @@ class AccountController < ApplicationControllerendend- # def account_pending- #- # # Set back_url to make sure user is not redirected to an external login page- # # when registering via the external service. This also redirects the user- # # to the original page where the user clicked on the omniauth login link for a provider.- # redirect_to action: 'login', back_url: params[:back_url]- # end-def invited_userif session.include? :invitation_tokentoken = Token::Invitation.find_by_plaintext_value session[:invitation_token]diff --git a/app/controllers/concerns/accounts/user_limits.rb b/app/controllers/concerns/accounts/user_limits.rbindex dd76f35fb49..fbceb14ac2e 100644--- a/app/controllers/concerns/accounts/user_limits.rb+++ b/app/controllers/concerns/accounts/user_limits.rb@@ -55,7 +55,7 @@ module Accounts::UserLimitsdef enforce_activation_user_limit(user: nil, redirect_to: signin_path)if user_limit_reached?- show_user_limit_activation_error!+ flash[:error] = I18n.t(:error_enterprise_activation_user_limit)send_activation_limit_notification_about user if userredirect_back fallback_location: redirect_to