From 50f5e460f6705d22e6ea230d96744cfb9e4104ee Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 6 Feb 2011 21:54:51 +0100 Subject: [PATCH] Don't propose promotion ml subscription if the list does not exist. Signed-off-by: Florent Bruneau --- include/reminder/promotion_ml.inc.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/reminder/promotion_ml.inc.php b/include/reminder/promotion_ml.inc.php index 8176320..5900a00 100644 --- a/include/reminder/promotion_ml.inc.php +++ b/include/reminder/promotion_ml.inc.php @@ -79,7 +79,16 @@ class ReminderPromotionMl extends Reminder if ($mlCount) { Reminder::MarkCandidateAsAccepted($user->id(), $candidate); } - return ($mlCount == 0); + if ($mlCount == 0) { + $mmlist = new MMList($user); + try { + $mmlist->get_members_limit('promo' + $user->profile()->yearPromo(), + 0, 0); + } catch (Exception $e) { + return false; + } + } + return false; } } -- 2.1.4