Call project project user assignment job with perform now [SCi-9750] (#6766)

* Add polling to update project user assignments list [SCi-9750]

* Call project project user assignment job with perform now [SCI-9750]

* Call UserAssignments::PropagateAssignmentJob directly from destroy action SCI-[9750]
This commit is contained in:
wandji 2023-12-08 10:27:50 +01:00 committed by GitHub
parent 98b8c25c59
commit 6f27b4c450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -99,7 +99,13 @@ module AccessPermissions
raise ActiveRecord::RecordInvalid
end
propagate_job(user_assignment, destroy: true)
UserAssignments::PropagateAssignmentJob.perform_now(
@project,
user_assignment.user.id,
user_assignment.user_role,
current_user.id,
destroy: true
)
log_activity(:unassign_user_from_project, { user_target: user_assignment.user.id,
role: user_assignment.user_role.name })

View file

@ -337,7 +337,7 @@ class Project < ApplicationRecord
def auto_assign_project_members
return if skip_user_assignments
UserAssignments::ProjectGroupAssignmentJob.perform_later(
UserAssignments::ProjectGroupAssignmentJob.perform_now(
team,
self,
last_modified_by&.id || created_by&.id