Quick correction to only send an email if a submitter email is present
This commit is contained in:
parent
b4c4e28165
commit
845e0d0983
@ -27,7 +27,8 @@ 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!
|
||||
@ -35,9 +36,10 @@ class Orga < ActiveRecord::Base
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user