Fixed issue 2624, Creating command to charge all members for their membership month, Fixing bug on make charge membership command, Added language activation for make charge command

This commit is contained in:
Levi 2016-10-01 17:17:46 -05:00
commit 1a8b5e69a0
8 changed files with 466 additions and 9 deletions

View file

@ -63,6 +63,11 @@ class Membership(models.Model):
type = models.ForeignKey(MembershipType)
active = models.BooleanField(default=True)
@classmethod
def create(cls, data):
instance = cls.objects.create(**data)
return instance
@classmethod
def is_digitalglarus_active_member(cls, user):
past_month = (datetime.today() - relativedelta(months=1)).month
@ -74,11 +79,6 @@ class Membership(models.Model):
return cls.objects.filter(has_booking_past_month | has_booking_current_month).\
filter(active_membership).exists()
@classmethod
def create(cls, data):
instance = cls.objects.create(**data)
return instance
def deactivate(self):
self.active = False
self.save()