'Place potential swappable models first in lists of created models (only
real way to solve #22783).'

def swappable_first_key(self, item):

    with suppress(LookupError):
        model = self.new_apps.get_model(item[0], item[1])
        base_names = [base.__name__ for base in model.__bases__]
        string_version = ('%s.%s' % (item[0], item[1]))
        if (model._meta.swappable or ('AbstractUser' in base_names) or ('AbstractBaseUser' in base_names) or (settings.AUTH_USER_MODEL.lower() == string_version.lower())):
            return (('___' + item[0]), ('___' + item[1]))
    return item
