def get_formatted_journal(result, characters_remaining):
    """

    Args:
        result: (dict) db entry
        characters_remaining: (int) number of characters remaining in field

    Returns:
        (str) name of journal, (int) number of characters remaining in line
    """
    journal_obj = result.get("journal", "")
    if journal_obj is None or len(journal_obj) == 0:
        journal = ""
    elif isinstance(journal_obj, list):
        journal = journal_obj[0]
    else:
        # should be a string by this point
        journal = journal_obj

    short_journal = ""

    if len(journal) > 20:
        if len(short_journal) > 0:
            journal = short_journal
        else:
            journal = journal[0:30] + "..."
    characters_remaining -= len(journal)
    return journal, characters_remaining