Commits

Greg Reinbach committed e99677c

updated to django 1.2
gracefully handles missing cheddargetter product code

  • Participants
  • Parent commits 3ca58a3

Comments (0)

Files changed (1)

apps/account/models.py

 #---------------------------------------------------------------------------
 def get_plan_list():
     payment_plan_list = {}
-    for plan in payment.Plan.all():
-        payment_plan_list[plan.id] = plan.recurring_charge_amount
-    plan_list = Plan.all().filter('is_active =', True)
+    try:
+        for plan in payment.Plan.all():
+            payment_plan_list[plan.id] = plan.recurring_charge_amount
+        plan_list = Plan.all().filter('is_active =', True)
+    except Exception, e:
+        logging.info('%s' % e)
+        plan_list = []
     merged_plan_list = []
     for plan in plan_list:
         setattr(plan, 'rate', payment_plan_list.get(plan.plan_key, None))