def update_org_owner(cls, module):
        """
        Creates the links to the organization and organization user for the owner.
        """
        try:
            cls.module_registry[module]["OrgOwnerModel"]._meta.get_field(
                "organization_user"
            )
        except FieldDoesNotExist:
            cls.module_registry[module]["OrgOwnerModel"].add_to_class(
                "organization_user",
                models.OneToOneField(
                    cls.module_registry[module]["OrgUserModel"],
                    on_delete=models.CASCADE,
                ),
            )
        try:
            cls.module_registry[module]["OrgOwnerModel"]._meta.get_field("organization")
        except FieldDoesNotExist:
            cls.module_registry[module]["OrgOwnerModel"].add_to_class(
                "organization",
                models.OneToOneField(
                    cls.module_registry[module]["OrgModel"],
                    related_name="owner",
                    on_delete=models.CASCADE,
                ),
            )
def update_org_owner ( cls , module ) : try : cls . module_registry [ module ] [ "OrgOwnerModel" ] . _meta . get_field ( "organization_user" ) except FieldDoesNotExist : cls . module_registry [ module ] [ "OrgOwnerModel" ] . add_to_class ( "organization_user" , models . OneToOneField ( cls . module_registry [ module ] [ "OrgUserModel" ] , on_delete = models . CASCADE , ) , ) try : cls . module_registry [ module ] [ "OrgOwnerModel" ] . _meta . get_field ( "organization" ) except FieldDoesNotExist : cls . module_registry [ module ] [ "OrgOwnerModel" ] . add_to_class ( "organization" , models . OneToOneField ( cls . module_registry [ module ] [ "OrgModel" ] , related_name = "owner" , on_delete = models . CASCADE , ) , )
Creates the links to the organization and organization user for the owner.