Skip to content

Commit

Permalink
Remove is_resigned field from Member
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsierro committed Jul 13, 2024
1 parent 610745b commit bc5ddb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions members/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def formatted_name(self, member):
search_fields = ['name', 'surname', 'rfid', 'visa']
ordering = ['name', 'surname']
readonly_fields = ['get_tariff', 'is_in_mail_list']
list_filter = ['subscription_status']


admin.site.register(Member, MemberAdmin)
5 changes: 4 additions & 1 deletion members/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Member(models.Model):
member_type = models.CharField(max_length=20, choices=MEMBER_TYPE, default='membre', null=False, blank=False)
subscription_status = models.CharField("Etat de l'inscription", max_length=20, choices=SUBSCRIPTION_STATUS, default='subscribing', null=False, blank=False)
date_added = models.DateField('Date ajout', default=date.today, null=True, blank=True)
is_resigned = models.BooleanField('Démission', default=False)
date_resigned = models.DateField('Date démission', default=None, null=True, blank=True)
is_staff = models.BooleanField('Animateur', default=False)
is_allowed_to_open_cash_register = models.BooleanField('Ouverture caisse (pour non animateur)', default=False, null=False, blank=False)
Expand All @@ -84,6 +83,10 @@ def is_in_mail_list(self):
and self.member_type not in['no_member'] \
and not self.is_resigned

@property
def is_resigned(self):
return self.date_resigned is not None

def __str__(self):
return f'{self.name} {self.surname}'

Expand Down

0 comments on commit bc5ddb3

Please sign in to comment.