Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Fix for bug 916323 -
Browse files Browse the repository at this point in the history
 making sure that we delete all applications and re-verify
 before force-deleting a domain
  • Loading branch information
Abhishek Gupta committed Feb 27, 2013
1 parent 17526d3 commit ed2a45b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions controller/app/controllers/domains_controller.rb
Expand Up @@ -149,10 +149,15 @@ def destroy
end

if force
domain.applications.each do |app|
app.destroy_app
apps = domain.with(consistency: :strong).applications
while apps.count > 0
apps.each do |app|
app.destroy_app
end
domain.with(consistency: :strong).reload
apps = domain.with(consistency: :strong).applications
end
elsif not domain.applications.empty?
elsif not domain.with(consistency: :strong).applications.empty?
return render_error(:bad_request, "Domain contains applications. Delete applications first or set force to true.", 128, "DELETE_DOMAIN")
end

Expand Down

0 comments on commit ed2a45b

Please sign in to comment.