def get_author_from_parties(parties):
    """
    Return an author string built from a ``parties`` list of party mappings, or
    None.
    """
    if not parties:
        return

    # get all entries with role author and join their names
    authors = [a['name']  for a in parties if a['role'] == 'author']
    authors = '\n'.join(a for a in authors if a)
    return authors or None