def check_function(app_configs, **kwargs): # if app_configs list is given (e.g. otree check app1 app2), run on those # if it's None, run on all apps # (system check API requires this) app_configs = app_configs or _get_all_configs() errors = [] for app_config in app_configs: helper = AppCheckHelper(app_config, errors) func(helper, **kwargs) return errors
def wrapper(app_configs, **kwargs): if once_per_project: # some checks should only be run once, not for each app app_configs = [apps.get_app_config('otree')] else: # if app_configs list is given (e.g. otree check app1 app2), run on those # if it's None, run on all apps # (system check API requires this) app_configs = app_configs or _get_all_configs() errors = [] for config in app_configs: rules = Rules(config, errors, id=id) func(rules, **kwargs) return errors