def _schedule_filter_conditions(form, module, case): phase = form.get_phase() try: form_xpath = QualifiedScheduleFormXPath(form, phase, module, case_xpath=case) relevant = form_xpath.filter_condition(phase.id) except ScheduleError: relevant = None return relevant