From f0181e4ca97df186630e45b1d3572eb4e9aec8d2 Mon Sep 17 00:00:00 2001 From: Yuhuai Liu Date: Mon, 30 Sep 2024 08:49:24 -0400 Subject: [PATCH] only return the addon with the right name --- osf/models/node.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/osf/models/node.py b/osf/models/node.py index 0b31e2d5d0e..d73e501b2c4 100644 --- a/osf/models/node.py +++ b/osf/models/node.py @@ -2431,20 +2431,9 @@ def _remove_from_associated_collections(self, auth=None, force=False): ) def _get_addon_from_gv(self, gv_pk, requesting_user_id): - requesting_user = OSFUser.load(requesting_user_id) - all_node_addon_data = [item for item in gv_requests.iterate_addons_for_resource( - requested_resource=self, - requesting_user=requesting_user)] - # gv_addon_data = gv_requests.get_addon( - # gv_addon_pk=gv_pk, - # requested_resource=self, - # requesting_user=requesting_user, - # ) - return gv_translations.make_ephemeral_node_settings( - gv_addon_data=all_node_addon_data[0], - requested_resource=self, - requesting_user=requesting_user - ) + for item in self._get_addons_from_gv(requesting_user_id): + if item.short_name == gv_pk: + return item def _get_addons_from_gv(self, requesting_user_id): requesting_user = OSFUser.load(requesting_user_id)