error email when the ApprovalGroup is not found

Raphy, I think this is ready to merge.
That would be better --- in fact it should be logged.  It is a question of
priorities.


On Fri, Jun 20, 2014 at 12:58 PM, Raphael Villas <notifications@github.com>
wrote:

> In app/controllers/communicarts_controller.rb:
>
> > @@ -20,10 +20,14 @@ def send_cart
> >
> >      if !approval_group_name.blank?
> >        approval_group = ApprovalGroup.find_by(name: approval_group_name)
> > -      unless duplicated_approvals_exist_for(cart)
> > -        approval_group.user_roles.each do | user_role |
> > -          Approval.create!(user_id: user_role.user_id, cart_id: cart.id, role: user_role.role)
> > -          CommunicartMailer.cart_notification_email(user_role.user.email_address, params, cart).deliver if user_role.role == "approver"
> > +      if (approval_group.blank?)
> > +        CommunicartMailer.unfound_approval_group_email(params)
>
> Consider raising an exception and handling it by sending the email.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/18F/C2/pull/8/files#r14029805>.
>



-- 
Robert L. Read, PhD
Presidential Innovation Fellow, 2013