Commit d43914ce authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove subtransaction from DastSite

This changes the service to use regular find_or_create_by so that we
don't start a subtransaction
parent b50ffcb5
......@@ -7,7 +7,7 @@ module DastSites
def execute!(url:)
raise PermissionsError, 'Insufficient permissions' unless allowed?
find_or_create_by!(url)
DastSite.find_or_create_by!(project: project, url: url) # rubocop:disable CodeReuse/ActiveRecord
end
private
......@@ -15,9 +15,5 @@ module DastSites
def allowed?
Ability.allowed?(current_user, :create_on_demand_dast_scan, project)
end
def find_or_create_by!(url)
DastSite.safe_find_or_create_by!(project: project, url: url)
end
end
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