async def order_link_on_insert(sender: Type[Model], instance: Model, **kwargs: Any):
    """
    Signal receiver registered on Link model, triggered every time before one is created
    by calling save() on a model. Note that signal functions for pre_save signal accepts
    sender class, instance and have to accept **kwargs even if it's empty as of now.
    """
    rel_one, rel_two = _get_through_model_relations(sender, instance)
    await _populate_order_on_insert(
        sender=sender, instance=instance, from_class=rel_one, to_class=rel_two
    )
    await _populate_order_on_insert(
        sender=sender, instance=instance, from_class=rel_two, to_class=rel_one
    )

    Signal receiver registered on Link model, triggered every time before one is created
    by calling save() on a model. Note that signal functions for pre_save signal accepts
    sender class, instance and have to accept **kwargs even if it's empty as of now.
    
tests/test_ordering/test_default_through_relation_order.py