Commit 16681941 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Fix problems when saving a user that is marked as chair of a committee

parent 45504919
......@@ -160,7 +160,7 @@ class CommitteeMembership(models.Model):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if is None:
if is not None:
self._was_chair = bool(self.chair)
self._was_chair = False
......@@ -224,10 +224,10 @@ class CommitteeMembership(models.Model):
if ( is not None and self._was_chair != self.chair and
not self.until):"Creating new membership instance")
self.until =
self.until = - datetime.timedelta(days=1)
super().save(*args, **kwargs) = None # forces INSERT
self.since = self.until # Set since date to older expiration
self.since = # Set since date to older expiration
self.until = None
super().save(*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