async def reorder_links_on_update(
    sender: Type[ormar.Model], instance: ormar.Model, passed_args: Dict, **kwargs: Any
):
    """
    Signal receiver registered on Link model, triggered every time before one is updated
    by calling update() on a model. Note that signal functions for pre_update signal
    accepts sender class, instance, passed_args which is a dict of kwargs passed to
    update and have to accept **kwargs even if it's empty as of now.
    """

    rel_one, rel_two = _get_through_model_relations(sender, instance)
    await _reorder_on_update(
        sender=sender,
        instance=instance,
        from_class=rel_one,
        to_class=rel_two,
        passed_args=passed_args,
    )
    await _reorder_on_update(
        sender=sender,
        instance=instance,
        from_class=rel_two,
        to_class=rel_one,
        passed_args=passed_args,
    )

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