diff --git a/app/models/orga.rb b/app/models/orga.rb index e30bfb8c..9768c80e 100644 --- a/app/models/orga.rb +++ b/app/models/orga.rb @@ -27,17 +27,19 @@ class Orga < ActiveRecord::Base end after_update do - send_secret if secret_changed? && submitter + if submitter + send_secret if secret_changed? - if moderated_changed? - OrgaMailer.accept(self).deliver_now! - else - OrgaMailer.update(self).deliver_now! + if moderated_changed? + OrgaMailer.accept(self).deliver_now! + else + OrgaMailer.update(self).deliver_now! + end end end before_destroy do - OrgaMailer.destroy(self).deliver_now! + OrgaMailer.destroy(self).deliver_now! if submitter end def send_secret