[member] Handle unlimited memberships

This commit is contained in:
Benjamin Graillot 2019-09-18 16:41:01 +02:00
parent d826dc9d20
commit 1ac63cbed1
1 changed files with 4 additions and 1 deletions

View File

@ -146,7 +146,10 @@ class Membership(models.Model):
) )
def valid(self): def valid(self):
return self.date_start <= datetime.datetime.now() < self.date_end if self.date_end is not None:
return self.date_start <= datetime.datetime.now() < self.date_end
else:
return self.date_start <= datetime.datetime.now()
class Meta: class Meta:
verbose_name = _('membership') verbose_name = _('membership')