From bf4b97e16e0c1a699ddd2fc186ea3f8e962ec7bf Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 21 Aug 2012 07:43:16 +0100 Subject: Email admins about external requests too If someone reports an external request as needing administrator attention, we should email the administrators about it. Thanks for spotting this, @crowbot. --- app/models/info_request.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 23e18b858..19ec949ba 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -567,8 +567,11 @@ public self.calculate_event_states - if self.requires_admin? && !self.is_external? - RequestMailer.deliver_requires_admin(self, set_by) + if self.requires_admin? + # Check there is someone to send the message "from" + if !set_by.nil? || !self.user.nil? + RequestMailer.deliver_requires_admin(self, set_by) + end end end -- cgit v1.2.3