Update dev_membership.py

This commit is contained in:
zainab2097 2024-08-08 13:07:32 +03:00 committed by GitHub
parent fe370800e5
commit 7ef300ab7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -148,10 +148,10 @@ class DevMembership(models.Model):
if self.product_id.nationality_ids: if self.product_id.nationality_ids:
if self.partner_id.nationality_id not in 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")) raise ValidationError(_("The member's nationality does not meet the membership requirements"))
if self.partner_id.age < 18: if self.product_id.age!=0 and self.partner_id.age !=self.product_id.age:
raise ValidationError(_('The member must be at least 18 years old.')) raise ValidationError(_('The member must be at least %s years old.')%self.product_id.age)
if self.partner_id.gender != self.product_id.gender and self.product_id.gender != False: if self.partner_id.gender != self.product_id.gender and self.product_id.gender != False:
raise ValidationError(_('Membership is only allowed for %s') % self.product_id.gender) raise ValidationError(_('Membership is only %s allowed') % self.product_id.gender)