Commit b69c66e2 authored by Baptiste Jonglez's avatar Baptiste Jonglez
Browse files

Optimise is_paid_up

parent 464de9c9
......@@ -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):
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment