Quick correction to only send an email if a submitter email is present
This commit is contained in:
parent
b4c4e28165
commit
845e0d0983
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user