+ def get_other_active_recurring(self):
+ schedules = type(self).objects.exclude(
+ monthly=False, yearly=False
+ ).filter(is_cancelled=False, expires_at__gt=now()).exclude(pk=self.pk)
+ mine_q = models.Q(email=self.email)
+ if self.membership is not None:
+ mine_q |= models.Q(membership__user=self.membership.user)
+ schedules = schedules.filter(mine_q)
+ return schedules.order_by('-expires_at').first()
+