diff options
author | Jeff Bradberry <jeff.bradberry@gmail.com> | 2024-01-25 16:31:14 +0100 |
---|---|---|
committer | Seth Foster <fosterseth@users.noreply.github.com> | 2024-02-02 16:37:41 +0100 |
commit | 8f22188116b24f5094f3e8ffd33de02727ea03a9 (patch) | |
tree | 487cfe4429b8fff326630f07c3ce48a8256b1ef5 | |
parent | Placeholder FIXMEs for things of concern (diff) | |
download | awx-8f22188116b24f5094f3e8ffd33de02727ea03a9.tar.xz awx-8f22188116b24f5094f3e8ffd33de02727ea03a9.zip |
Use a select_related to build the peers queryset in the install bundle
Since the relationship is ReceptorAddress -> Instance,
prefetch_related isn't necessary.
-rw-r--r-- | awx/api/views/instance_install_bundle.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/awx/api/views/instance_install_bundle.py b/awx/api/views/instance_install_bundle.py index eefb9d0b6a..6e4d802ed0 100644 --- a/awx/api/views/instance_install_bundle.py +++ b/awx/api/views/instance_install_bundle.py @@ -126,7 +126,7 @@ def generate_inventory_yml(instance_obj): def generate_group_vars_all_yml(instance_obj): # get peers peers = [] - for addr in instance_obj.peers.all().prefetch_related('instance'): + for addr in instance_obj.peers.select_related('instance'): peers.append(dict(address=addr.get_full_address(), protocol=addr.protocol)) context = dict(instance=instance_obj, peers=peers) |