Commit 8434dd57 authored by Thom Wiggers's avatar Thom Wiggers 📐

Merge branch 'feature/update-is-staff' into 'master'

Update is_staff when changing committee memberships

Close #92 

See merge request !100
parents 0764e3f9 efd4b48a
......@@ -236,6 +236,10 @@ class CommitteeMembership(models.Model, metaclass=ModelTranslateMeta):
self._was_chair = self.chair
super().save(*args, **kwargs)
self.member.user.is_staff = self.member.membership_set.exclude(
until__lt=timezone.now().date()).count() >= 1
self.member.user.save()
def delete(self, *args, **kwargs):
"""Deactivates active memberships, deletes inactive ones"""
if self.is_active:
......
Markdown is supported
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