From 05cd1e2144759a7711f9ee418cdfb95202dbf548 Mon Sep 17 00:00:00 2001 From: samyou-softwire Date: Tue, 14 Apr 2026 17:32:39 +0100 Subject: [PATCH] fixup! CLDC-4332: Only show the check for wrong org on edit lint --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 57ef2c04f..677925679 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -224,7 +224,7 @@ private if user_params.key?(:organisation_id) if user_params[:organisation_id].blank? @user.errors.add :organisation_id, :blank - elsif !@user.role_is_allowed_to_be_in_organisation?(override_organisation_id: user_params[:organisation_id].to_i) && @user.id != nil + elsif !@user.role_is_allowed_to_be_in_organisation?(override_organisation_id: user_params[:organisation_id].to_i) && @user.id.present? # this will also be flagged by the validation in user.rb. # for convenience we show the error early before they go through the change org flow (involves reassigning logs). @user.errors.add :organisation_id, I18n.t("validations.user.support_user_in_wrong_organisation.change_organisation")