Skip to content
Snippets Groups Projects
Select Git revision
21 results Searching

tooltip.directive.ts

Blame
  • enqueue.py 1.05 KiB
    #Note to change it to a background job, just this file would need to be be edited 
    #please look up the branch URL_Upload 
    
    from .thumbnail import create_thumbnail, create_thumbnail_for_last_resource
    import ckan.plugins.toolkit as toolkit
    
    def enqueue_after_create(context, resource):
        package = context.get('package')
        private = package.private
        
        # without the background job
        create_thumbnail(resource, private)
    
    def enqueue_after_update(context, resource):
        package = context.get('package')
        private = package.private
        package_id = package.id
        package = toolkit.get_action('package_show')(context, {'id':package_id})
        resources = package.get('resources')
        
        # without the background job
        create_thumbnail_for_last_resource(resources, private, package_id)
    
    def enqueue_after_delete(context, resources):
        package = context.get('package')
        private = package.private
        package_id = package.id
                
        # without the background job
        create_thumbnail_for_last_resource(resources, private, package_id)