"""Content Review Account Blocklist Model.""" from owsresponse import response from owsresponse.status import OK from pythonfeatures import pythonfeatures from pythonfeatures.constants import split as split_constants def is_vendor_or_subaccount_on_blocklist(*, vendor_id, subaccount_id): """Check if vendor or subaccount is on blocklist.""" # This is located here instead of product_digital.features because we're using this split not as a feature flag, # but as a data source for the account blocklist that select internal users will be able to maintain using the # split.io frontend. account_blocklist_response = pythonfeatures.get_single_feature_by_attributes( 'content_review_account_blocklist', {'vendor_id': vendor_id, 'subaccount_id': subaccount_id} ) if account_blocklist_response.status != OK: return account_blocklist_response return response.Response(account_blocklist_response.message == split_constants.FEATURE_ENABLED)