Merge pull request #22674 from ruchamahabal/fix-sla-error

fix(Support): TypeError while saving Service Level Agreement
This commit is contained in:
Rucha Mahabal 2020-07-14 13:33:19 +05:30 committed by GitHub
commit b81dca8146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,8 +21,8 @@ class ServiceLevelAgreement(Document):
for priority in self.priorities:
# Check if response and resolution time is set for every priority
if not (priority.response_time or priority.resolution_time):
frappe.throw(_("Set Response Time and Resolution for Priority {0} at index {1}.").format(priority.priority, priority.idx))
if not priority.response_time or not priority.resolution_time:
frappe.throw(_("Set Response Time and Resolution Time for Priority {0} in row {1}.").format(priority.priority, priority.idx))
priorities.append(priority.priority)
@ -33,7 +33,7 @@ class ServiceLevelAgreement(Document):
resolution = priority.resolution_time
if response > resolution:
frappe.throw(_("Response Time for {0} at index {1} can't be greater than Resolution Time.").format(priority.priority, priority.idx))
frappe.throw(_("Response Time for {0} priority in row {1} can't be greater than Resolution Time.").format(priority.priority, priority.idx))
# Check if repeated priority
if not len(set(priorities)) == len(priorities):