Skip to content

Commit

Permalink
only return the addon with the right name
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Sep 30, 2024
1 parent 9bb89a2 commit f0181e4
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions osf/models/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f0181e4

Please sign in to comment.