unordered types None vs int

This commit is contained in:
Achilles Rasquinha 2018-03-15 12:18:37 +05:30
parent bb5caf8fad
commit a4a62d5ea1

View File

@ -76,7 +76,7 @@ class Project(Document):
def validate_weights(self):
sum = 0
for task in self.tasks:
if task.task_weight > 0:
if task.task_weight or 0 > 0:
sum = sum + task.task_weight
if sum > 0 and sum != 1:
frappe.throw(_("Total of all task weights should be 1. Please adjust weights of all Project tasks accordingly"))