def assignment_display_name(assignment):
    """Get name for an assignment"""
    if assignment.session.type.slug == 'regular' and assignment.session.historic_group:
        return assignment.session.historic_group.name
    return assignment.session.name or assignment.timeslot.name