Commit bca8186f authored by Chloe Liu's avatar Chloe Liu

Merge branch 'qa-shl-de-duplicate-already-marked-for-deletion-check' into 'master'

De-duplicate already marked for deletion check

See merge request gitlab-org/gitlab!82173
parents 9799ed43 d303bebf
......@@ -65,7 +65,7 @@ module QA
end
def marked_for_deletion?
!parse_body(api_get_from(api_get_path.to_s))[:marked_for_deletion_on].nil?
reload!.api_response[:marked_for_deletion_on].present?
end
# Get group badges
......
......@@ -34,9 +34,8 @@ module QA
def remove_all_via_api!
instance.each_resource do |reuse_as, resource|
next QA::Runtime::Logger.debug("#{resource.class.name} reused as :#{reuse_as} has already been removed.") unless resource.exists?
next if resource.respond_to?(:marked_for_deletion?) && resource.marked_for_deletion?
if resource.reload!.api_resource[:marked_for_deletion_on].present?
if resource.respond_to?(:marked_for_deletion?) && resource.marked_for_deletion?
next QA::Runtime::Logger.debug("#{resource.class.name} reused as :#{reuse_as} is already scheduled to be removed.")
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment