Permalink
Browse files

fixes #387

* add module Redmine::I18n
* skip to fetch if project was deleted. (hudson settings remain)
  • Loading branch information...
1 parent 9fe977f commit 3b21da5f9f0d136401c3c7aeeb3acce139f71f2c toshiyuki.ando1971 committed May 29, 2010
Showing with 4 additions and 1 deletion.
  1. +3 −1 app/models/hudson.rb
  2. +1 −0 app/models/hudson_exceptions.rb
View
@@ -122,11 +122,13 @@ def Hudson.find(*args)
when :all then
retval = []
HudsonSettings.find(*args).each do |settings|
+ next unless Project.find_by_id(settings.project_id)
retval << Hudson.new(settings.project_id)
end
return retval
else
settings = HudsonSettings.find(*args)
+ return nil unless Project.find_by_id(settings.project_id)
retval = Hudson.new(settings.project_id)
return retval
end
@@ -143,7 +145,7 @@ def Hudson.fetch
hudson.fetch
next if hudson.hudson_api_errors.empty?
hudson.hudson_api_errors.each do |error|
- $stderr.print "redmine_hudson: #{hudson.project.name}(#{hudson.settings.api_url}) #{error.class_name}:#{error.method_name} #{error.exception.message}\n"
+ $stderr.print "redmine_hudson: #{hudson.project.name}(#{hudson.settings.url_for(:plugin)}) #{error.class_name}:#{error.method_name} #{error.exception.message}\n"
end
end
end
@@ -13,6 +13,7 @@ class HudsonApiException < Exception
include ApplicationHelper
include ActionView::Helpers::TextHelper
+ include Redmine::I18n if RedmineHudson::RedmineExt.redmine_090_or_higher?
def initialize( object )
@code = ""

0 comments on commit 3b21da5

Please sign in to comment.