def handle(self, *args, **kwargs):
     with override_settings(CELERY_ALWAYS_EAGER=True):
         translation.activate('en-US')
         serializer = GenerateAddonsSerializer()
         serializer.create_generic_featured_addons()
         serializer.create_featured_addon_with_version()
         serializer.create_featured_theme()
         serializer.create_featured_collections()
         serializer.create_featured_themes()
         for addon in featured_collections:
             serializer.create_a_named_collection_and_addon(
                 addon, author='mozilla')
         for addon in base_collections:
             serializer.create_a_named_collection_and_addon(
                 addon, author='mozilla')
         for addon in hero_addons:
             serializer.create_named_addon_with_author(addon)
         serializer.create_installable_addon()
     cache.clear()
     call_command('clear_cache')
 def handle(self, *args, **kwargs):
     with override_settings(CELERY_ALWAYS_EAGER=True):
         translation.activate('en-US')
         serializer = GenerateAddonsSerializer()
         serializer.create_generic_featured_addons()
         serializer.create_featured_addon_with_version()
         serializer.create_featured_theme()
         serializer.create_featured_collections()
         serializer.create_featured_themes()
         for addon in featured_collections:
             serializer.create_a_named_collection_and_addon(
                 addon, author='mozilla')
         for addon in base_collections:
             serializer.create_a_named_collection_and_addon(
                 addon, author='mozilla')
         for addon in hero_addons:
             serializer.create_named_addon_with_author(addon)
         serializer.create_installable_addon()
     cache.clear()
     call_command('clear_cache')
Пример #3
0
    def handle(self, *args, **kwargs):
        # Disconnect reindexing for every save, we'll reindex
        # once all addons were generated
        post_save.disconnect(
            update_search_index, sender=Addon, dispatch_uid='addons.search.index'
        )

        with override_settings(CELERY_TASK_ALWAYS_EAGER=True):
            translation.activate('en-US')
            serializer = GenerateAddonsSerializer()
            serializer.create_generic_featured_addons()
            serializer.create_featured_addon_with_version()
            serializer.create_featured_theme()
            serializer.create_featured_collections()
            serializer.create_featured_themes()
            for addon in base_collections:
                serializer.create_a_named_collection_and_addon(addon, author='mozilla')
            for addon in hero_addons:
                serializer.create_a_named_collection_and_addon(addon, author='mozilla')
            for addon in hero_addons:
                serializer.create_named_addon_with_author(addon)
            serializer.create_installable_addon()
    def handle(self, *args, **kwargs):
        # Disconnect reindexing for every save, we'll reindex
        # once all addons were generated
        post_save.disconnect(update_search_index, sender=Addon,
                             dispatch_uid='addons.search.index')

        with override_settings(CELERY_ALWAYS_EAGER=True):
            translation.activate('en-US')
            serializer = GenerateAddonsSerializer()
            serializer.create_generic_featured_addons()
            serializer.create_featured_addon_with_version()
            serializer.create_featured_theme()
            serializer.create_featured_collections()
            serializer.create_featured_themes()
            for addon in featured_collections:
                serializer.create_a_named_collection_and_addon(
                    addon, author='mozilla')
            for addon in base_collections:
                serializer.create_a_named_collection_and_addon(
                    addon, author='mozilla')
            for addon in hero_addons:
                serializer.create_named_addon_with_author(addon)
            serializer.create_installable_addon()