Skip to content

Commit

Permalink
environments model - trivial spacing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
komidore64 committed Jan 30, 2014
1 parent c2e6e4b commit ef455b4
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/models/katello/kt_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def destroy_event

after_destroy :unset_users_with_default

ERROR_CLASS_NAME = "Environment"
ERROR_CLASS_NAME = "Environment"

def library?
self.library
Expand Down Expand Up @@ -181,12 +181,10 @@ def is_deletable?
return true if self.organization.nil? || self.organization.being_deleted?

if library?
errors.add :base,
_("Library environments may not be deleted.")
errors.add :base, _("Library environments may not be deleted.")
return false
elsif !successor.nil?
errors.add :base,
_("Environment %s has a successor. Only the last environment on a path can be deleted") % self.name
errors.add :base, _("Environment %s has a successor. Only the last environment on a path can be deleted") % self.name
return false
end

Expand Down Expand Up @@ -316,9 +314,9 @@ def available_releases

def create_default_content_view_version
if library?
#Sadly this has to be created here, if it is created in the org
# it will not actually exist when we go to create library and so
# we can't look it up via a query (org.default_content_view)
# Sadly this has to be created here, if it is created in the org
# it will not actually exist when we go to create library and so
# we can't look it up via a query (org.default_content_view)
content_view = self.organization.default_content_view
if content_view.nil?
content_view = Katello::ContentView.new(:default => true, :name => "Default Organization View",
Expand Down

0 comments on commit ef455b4

Please sign in to comment.