"""Helpers for orchard features.""" from common.constants.orchard_features import FEATURE_ENABLED from pythonfeatures import pythonfeatures def is_flag_enabled_for_vendor(flag_name, vendor_id, subaccount_id): """Check if feature flag is enabled for requested vendor.""" if not subaccount_id: subaccount_id = 0 treatment = pythonfeatures.get_single_feature_by_attributes( flag_name, {'vendor_id': vendor_id, 'subaccount_id': subaccount_id}) return treatment.message == FEATURE_ENABLED