Browse Source

Optimise is_paid_up

Baptiste Jonglez 10 years ago
parent
commit
b69c66e2c6
1 changed files with 4 additions and 5 deletions
  1. 4 5
      coin/members/models.py

+ 4 - 5
coin/members/models.py

@@ -113,15 +113,14 @@ class Member(CoinLdapSyncMixin, AbstractUser):
 
     def is_paid_up(self, date=None):
         """
-        True si le membre est à jour de cotisation à la date passée. False sinon
+        Teste si le membre est à jour de cotisation à la date donnée.
         """
         if date is None:
             date = datetime.date.today()
-        if self.end_date_of_membership() \
-                and self.end_date_of_membership() >= date:
-            return True
-        else:
+        end_date = self.end_date_of_membership()
+        if end_date is None:
             return False
+        return (end_date >= date)
 
     def set_password(self, new_password, *args, **kwargs):
         """