From 1ac63cbed1981005e4bf2b6a0518177b41b81598 Mon Sep 17 00:00:00 2001
From: Benjamin Graillot <graillot@crans.org>
Date: Wed, 18 Sep 2019 16:41:01 +0200
Subject: [PATCH] [member] Handle unlimited memberships

---
 apps/member/models.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/apps/member/models.py b/apps/member/models.py
index 2e84dc75..d1c3dea2 100644
--- a/apps/member/models.py
+++ b/apps/member/models.py
@@ -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')
-- 
GitLab