Update dev_membership.py
This commit is contained in:
parent
70e6dfa8a5
commit
7ef5c43960
|
|
@ -145,8 +145,9 @@ class DevMembership(models.Model):
|
|||
self.to_date = self.from_date + relativedelta(days=+self.duration)
|
||||
|
||||
def action_confirm_membership(self):
|
||||
if self.partner_id.nationality_id not in self.product_id.nationality_ids and self.product_id.nationality_ids != False:
|
||||
raise ValidationError(_("The member's nationality does not meet the membership requirements"))
|
||||
if self.product_id.nationality_ids:
|
||||
if self.partner_id.nationality_id not in self.product_id.nationality_ids:
|
||||
raise ValidationError(_("The member's nationality does not meet the membership requirements"))
|
||||
if self.partner_id.age < 18:
|
||||
raise ValidationError(_('The member must be at least 18 years old.'))
|
||||
if self.partner_id.gender != self.product_id.gender and self.product_id.gender != False:
|
||||
|
|
|
|||
Loading…
Reference in New Issue