def _include_file_data(login, record):
    """Ensure that 'files' field is present in the input record"""
    if 'files' not in record:
        if 'files' in record.get('links', {}):
            url = record['links']['files']
        elif 'id' in record:
            url = login.base_url + 'api/deposit/depositions/{0}/files'.format(record['id'])
        else:
            return record  # We have failed, but we're not too upset
        r = login.session.get(url)
        if r.status_code == 200:  # Otherwise, we just couldn't add this record; oh well.
            r_json = r.json()
            record['files'] = r_json
    return record