fix: conditions simplified

This commit is contained in:
pateljannat 2021-02-09 17:35:17 +05:30
parent f110759897
commit 1ab95413be

View File

@ -38,9 +38,9 @@ class LowerDeductionCertificate(Document):
def are_dates_overlapping(self,duplicate_certificate):
valid_from = duplicate_certificate.valid_from
valid_upto = duplicate_certificate.valid_upto
if valid_from <= getdate(self.valid_from) and getdate(self.valid_from) <= valid_upto:
if valid_from <= getdate(self.valid_from) <= valid_upto:
return True
elif valid_from <= getdate(self.valid_upto) and getdate(self.valid_upto) <= valid_upto:
elif valid_from <= getdate(self.valid_upto) <= valid_upto:
return True
elif getdate(self.valid_from) <= valid_from and valid_upto <= getdate(self.valid_upto):
return True