예제 #1
0
파일: models.py 프로젝트: ekush/commcare-hq
 def get_ota_restore_settings(self):
     # for some reason it doesn't like this import
     from casexml.apps.phone.restore import StockSettings
     default_product_ids = Product.ids_by_domain(self.domain) \
         if self.ota_restore_config.use_dynamic_product_list else []
     case_filter = lambda stub: stub.type in set(self.ota_restore_config.force_consumption_case_types)
     return StockSettings(
         section_to_consumption_types=self.ota_restore_config.section_to_consumption_types,
         consumption_config=self.get_consumption_config(),
         default_product_list=default_product_ids,
         force_consumption_case_filter=case_filter,
     )