X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3134405ebc155a8a51738b7c6d0d4be348c65087..733e8c44dacf230d605fe6e5ea3f95f0abb8d823:/services/api/app/controllers/sys_controller.rb diff --git a/services/api/app/controllers/sys_controller.rb b/services/api/app/controllers/sys_controller.rb index 08a672cc0b..a67b124bd0 100644 --- a/services/api/app/controllers/sys_controller.rb +++ b/services/api/app/controllers/sys_controller.rb @@ -17,14 +17,14 @@ class SysController < ApplicationController where('is_trashed = false and trash_at < statement_timestamp()'). update_all('is_trashed = true') - # Sweep trashed projects and their contents + # Sweep trashed projects and their contents (as well as role + # groups that were trashed before #18340 when that was + # disallowed) Group. - where({group_class: 'project'}). where('delete_at is not null and delete_at < statement_timestamp()').each do |project| delete_project_and_contents(project.uuid) end Group. - where({group_class: 'project'}). where('is_trashed = false and trash_at < statement_timestamp()'). update_all('is_trashed = true') @@ -38,8 +38,8 @@ class SysController < ApplicationController def delete_project_and_contents(p_uuid) p = Group.find_by_uuid(p_uuid) - if !p || p.group_class != 'project' - raise "can't sweep group '#{p_uuid}', it may not exist or not be a project" + if !p + raise "can't sweep group '#{p_uuid}', it may not exist" end # First delete sub projects Group.where({group_class: 'project', owner_uuid: p_uuid}).each do |sub_project|