|
@@ -129,19 +129,23 @@ class Member(CoinLdapSyncMixin, AbstractUser):
|
|
|
super(Member, self).set_password(new_password, *args, **kwargs)
|
|
|
self._password_ldap = utils.ldap_hash(new_password)
|
|
|
|
|
|
- def get_active_subscriptions(self, date=datetime.date.today()):
|
|
|
+ def get_active_subscriptions(self, date=None):
|
|
|
"""
|
|
|
Return list of OfferSubscription which are active today
|
|
|
"""
|
|
|
+ if date is None:
|
|
|
+ date = datetime.date.today()
|
|
|
return OfferSubscription.objects.filter(
|
|
|
Q(member__exact=self.pk),
|
|
|
Q(subscription_date__lte=date),
|
|
|
Q(resign_date__isnull=True) | Q(resign_date__gte=date))
|
|
|
|
|
|
- def get_inactive_subscriptions(self, date=datetime.date.today()):
|
|
|
+ def get_inactive_subscriptions(self, date=None):
|
|
|
"""
|
|
|
Return list of OfferSubscription which are not active today
|
|
|
"""
|
|
|
+ if date is None:
|
|
|
+ date = datetime.date.today()
|
|
|
return OfferSubscription.objects.filter(
|
|
|
Q(member__exact=self.pk),
|
|
|
Q(subscription_date__gt=date) |
|