def handle_unauthorized_file_type(error):
    '''Error occuring when the user try to upload a non-allowed file type'''
    url = url_for('api.allowed_extensions', _external=True)
    msg = (
        'This file type is not allowed.'
        'The allowed file type list is available at {url}'
    ).format(url=url)
    return {'message': msg}, 400
Error occuring when the user try to upload a non-allowed file type