(self)
return tuple(configs)
Access the notification's associated configs as a list, transparently
        returning an appropriate dummy for old notifications which have
        `report_slug` instead of `config_ids`.
Access the notification's associated configs as a list, transparently
        returning an appropriate dummy for old notifications which have
        `report_slug` instead of `config_ids`.
Access the notification s associated configs as a list transparently returning an appropriate dummy for old notifications which have report_slug instead of config_ids .
def configs(self):
        """
        Access the notification's associated configs as a list, transparently
        returning an appropriate dummy for old notifications which have
        `report_slug` instead of `config_ids`.
        """
        if self.config_ids:
            configs = []
            for config_doc in iter_docs(ReportConfig.get_db(), self.config_ids):
                config = ReportConfig.wrap(config_doc)
                if not hasattr(config, 'deleted'):
                    configs.append(config)

            def _sort_key(config_id):
                if config_id in self.config_ids:
                    return self.config_ids.index(config_id)
                else:
                    return len(self.config_ids)
            configs = sorted(configs, key=_sort_key)
        elif self.report_slug == 'admin_domains':
            raise UnsupportedScheduledReportError("admin_domains is no longer "
                "supported as a schedulable report for the time being")
        else:
            # create a new ReportConfig object, useful for its methods and
            # calculated properties, but don't save it
            class ReadonlyReportConfig(ReportConfig):

                def save(self, *args, **kwargs):
                    pass

            config = ReadonlyReportConfig()
            object.__setattr__(config, '_id', 'dummy')
            config.report_type = ProjectReportDispatcher.prefix
            config.report_slug = self.report_slug
            config.domain = self.domain
            config.owner_id = self.owner_id
            configs = [config]

        return tuple(configs)
def configs ( self ) : if self . config_ids : configs = [ ] for config_doc in iter_docs ( ReportConfig . get_db ( ) , self . config_ids ) : config = ReportConfig . wrap ( config_doc ) if not hasattr ( config , 'deleted' ) : configs . append ( config ) def _sort_key ( config_id ) : if config_id in self . config_ids : return self . config_ids . index ( config_id ) else : return len ( self . config_ids ) configs = sorted ( configs , key = _sort_key ) elif self . report_slug == 'admin_domains' : raise UnsupportedScheduledReportError ( "admin_domains is no longer " "supported as a schedulable report for the time being" ) else : # create a new ReportConfig object, useful for its methods and # calculated properties, but don't save it class ReadonlyReportConfig ( ReportConfig ) : def save ( self , * args , * * kwargs ) : pass config = ReadonlyReportConfig ( ) object . __setattr__ ( config , '_id' , 'dummy' ) config . report_type = ProjectReportDispatcher . prefix config . report_slug = self . report_slug config . domain = self . domain config . owner_id = self . owner_id configs = [ config ] return tuple ( configs )