def get_object_or_none(model_class, name):
    """
    Returns the object or None.
    """
    try:
        return model_class.objects.get(name=name)
    except model_class.DoesNotExist:
        return None