Skip to content

Commit

Permalink
Fix set_subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed Jan 14, 2025
1 parent 1838633 commit b80855b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/subjects/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


class UpdateSubjectsMixin:

def update_subjects_method(self, resource, subjects, auth, skip_share=False):
# Method to update subjects on resource
raise NotImplementedError()
Expand Down
6 changes: 4 additions & 2 deletions osf/models/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,8 @@ def set_subjects(self, new_subjects, auth, add_log=True, skip_share=False):
from osf.models.base import VersionedGuidMixin
if isinstance(self, VersionedGuidMixin):
self.update_search(skip_share=skip_share)
self.update_search()
else:
self.update_search()

def set_subjects_from_relationships(self, subjects_list, auth, add_log=True, skip_share=False):
""" Helper for setting M2M subjects field from list of flattened subjects received from UI.
Expand Down Expand Up @@ -1168,7 +1169,8 @@ def set_subjects_from_relationships(self, subjects_list, auth, add_log=True, ski
from osf.models.base import VersionedGuidMixin
if isinstance(self, VersionedGuidMixin):
self.update_search(skip_share=skip_share)
self.update_search()
else:
self.update_search()

def map_subjects_between_providers(self, old_provider, new_provider, auth=None):
"""
Expand Down

0 comments on commit b80855b

Please sign in to comment.