Add built-in support for using conditions in integrations.
Review Request #8369 — Created Aug. 30, 2016 and submitted
Integrations that want to work with conditions can now do so by adding
one or moreConditionsFields to their configuration form. These will
automatically be set up with the appropriate Local Site, ensuring that
any querysets contained within areLocalSite-aware. The integration can
then match against those conditions when iterating through the list of
enabled configurations through a newconfig.match_conditions()method.This all makes it very easy for an integration to allow for
customization based on conditions, without being locked into a
pre-determined set of condition choices or use cases.
Unit tests passed.
Manually tested all this with a new Slack integration.
Tool: PEP8 Style Checker Processed Files: reviewboard/testing/testcase.py reviewboard/integrations/forms.py reviewboard/integrations/models.py reviewboard/integrations/tests/test_configs.py reviewboard/integrations/tests/test_views.py reviewboard/integrations/tests/test_forms.py reviewboard/integrations/views.py Ignored Files: reviewboard/integrations/tests/__init__.py Tool: Pyflakes Processed Files: reviewboard/testing/testcase.py reviewboard/integrations/forms.py reviewboard/integrations/models.py reviewboard/integrations/tests/test_configs.py reviewboard/integrations/tests/test_views.py reviewboard/integrations/tests/test_forms.py reviewboard/integrations/views.py Ignored Files: reviewboard/integrations/tests/__init__.py