blueprints/api_tasks.py
def tasks_type_download_route(type_id=None):
    """This flask def is used to downloads a script for a given task type ID.

    Params:
        id: The task type ID to download, specific as a URL location
    """
    bin_directory = "data/task_bin/"

    if type_id != None:
        logger.debug('A task type ID has been provided to download', extra={'type_id':type_id})

        query_results = get_task_type(str(type_id))

        if len(query_results ) > 1:
            logger.error('Dupicate task type ID found in database', extra={'query_results':query_results, 'type_id':type_id})
            data = []
            return return_response(502, "Duplicate results for that ID", False, None, data, 502)

        elif len(query_results) > 0:
            data = query_results[0]
            return send_from_directory(directory=bin_directory, filename=str(data[4]), as_attachment=True)
        else:
            data = []
            return return_response(200, "No task type found for that ID", False, None, data, 200)
    else:
        return return_response(406, "You did not specify a task type to download", False, None, data, 406)
This flask def is used to downloads a script for a given task type ID.

    Params:
        id: The task type ID to download, specific as a URL location
    
This flask def is used to downloads a script for a given task type ID.
This flask def is used to downloads a script for a given task type ID .
def tasks_type_download_route(type_id=None):
    bin_directory = "data/task_bin/"
    if type_id != None:
        logger.debug('A task type ID has been provided to download', extra={'type_id':type_id})
        query_results = get_task_type(str(type_id))
        if len(query_results ) > 1:
            logger.error('Dupicate task type ID found in database', extra={'query_results':query_results, 'type_id':type_id})
            data = []
            return return_response(502, "Duplicate results for that ID", False, None, data, 502)
        elif len(query_results) > 0:
            data = query_results[0]
            return send_from_directory(directory=bin_directory, filename=str(data[4]), as_attachment=True)
        else:
            data = []
            return return_response(200, "No task type found for that ID", False, None, data, 200)
    else:
        return return_response(406, "You did not specify a task type to download", False, None, data, 406)
def tasks_type_download_route ( type_id = None ) : bin_directory = "data/task_bin/" if type_id != None : logger . debug ( 'A task type ID has been provided to download' , extra = { 'type_id' : type_id } ) query_results = get_task_type ( str ( type_id ) ) if len ( query_results ) > 1 : logger . error ( 'Dupicate task type ID found in database' , extra = { 'query_results' : query_results , 'type_id' : type_id } ) data = [ ] return return_response ( 502 , "Duplicate results for that ID" , False , None , data , 502 ) elif len ( query_results ) > 0 : data = query_results [ 0 ] return send_from_directory ( directory = bin_directory , filename = str ( data [ 4 ] ) , as_attachment = True ) else : data = [ ] return return_response ( 200 , "No task type found for that ID" , False , None , data , 200 ) else : return return_response ( 406 , "You did not specify a task type to download" , False , None , data , 406 )
This flask def is used to downloads a script for a given task type ID.
This flask def is used to downloads a script for a given task type ID .
"""This flask def is used to downloads a script for a given task type ID.

    Params:
        id: The task type ID to download, specific as a URL location
    """
type_id
id
The task type ID to download, specific as a URL location
The task type ID to download specific as a URL location