From: Florent Bruneau Date: Sun, 6 Feb 2011 20:54:51 +0000 (+0100) Subject: Don't propose promotion ml subscription if the list does not exist. X-Git-Tag: xorg/1.1.0~1^2~40 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=50f5e460f6705d22e6ea230d96744cfb9e4104ee;p=platal.git Don't propose promotion ml subscription if the list does not exist. Signed-off-by: Florent Bruneau --- 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; } }