1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

[member] Handle unlimited memberships

This commit is contained in:
Benjamin Graillot 2019-09-18 16:41:01 +02:00
parent d826dc9d20
commit 1ac63cbed1

View File

@ -146,7 +146,10 @@ class Membership(models.Model):
)
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:
verbose_name = _('membership')