Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1008 | Collection ref add/delete will updat…
Browse files Browse the repository at this point in the history
…e child count
  • Loading branch information
snyaggarwal committed Nov 10, 2021
1 parent a7a8a19 commit 7058083
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/collections/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ def add_references(self, expressions, user=None): # pylint: disable=too-many-lo
collection_version.updated_by = user
self.updated_by = user
collection_version.save()
collection_version.update_children_counts()
if collection_version.id != self.id:
self.save()
return added_references, errors
Expand Down Expand Up @@ -297,6 +298,7 @@ def delete_references(self, expressions):

from core.concepts.documents import ConceptDocument
from core.mappings.documents import MappingDocument
head.update_children_counts()
self.batch_index(Concept.objects.filter(uri__in=expressions), ConceptDocument)
self.batch_index(Mapping.objects.filter(uri__in=expressions), MappingDocument)

Expand Down

0 comments on commit 7058083

Please sign in to comment.