Update policy.py

This commit is contained in:
joe-arriaga 2019-03-06 09:50:52 -08:00 committed by GitHub
parent 6cd7903555
commit f2943e1d69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,7 @@ planning_section = Section(
"preferred_flight_fare": {"number": 6, "label": "Fare of your preferred flight", "field_type": "decimal"}, "preferred_flight_fare": {"number": 6, "label": "Fare of your preferred flight", "field_type": "decimal"},
"preferred_flight_duration": {"number": 7, "label": "Flight duration of your preferred flight (hours)", "field_type": "decimal"}, "preferred_flight_duration": {"number": 7, "label": "Flight duration of your preferred flight (hours)", "field_type": "decimal"},
"international_flight": {"number": 8, "label": "Is this an international flight?", "field_type": "boolean"}, "international_flight": {"number": 8, "label": "Is this an international flight?", "field_type": "boolean"},
"economy_class": {"number": 9, "label": "Is your ticket in economy/coach?", "field_type": "boolea n"}, "economy_class": {"number": 9, "label": "Is your ticket in economy/coach?", "field_type": "boolean"},
} }
) )
@ -145,7 +145,7 @@ def departure_date_limit_rule(report, fields):
planning_section.add_rule(title="Departure date limit", rule=departure_date_limit_rule) planning_section.add_rule(title="Departure date limit", rule=departure_date_limit_rule)
def economy_class_rule(report, fields): def economy_class_rule(report, fields):
if not economy_class: if not fields.economy_class:
return "Only economy or coach class tickets are within policy." return "Only economy or coach class tickets are within policy."
planning_section.add_rule(title="Economy class check", rule=economy_class_rule) planning_section.add_rule(title="Economy class check", rule=economy_class_rule)