Skip to content

Commit

Permalink
Added re-indexing of data sets when they are un-shared.
Browse files Browse the repository at this point in the history
  • Loading branch information
flekschas committed Jun 29, 2015
1 parent 4859a13 commit d00bb44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions refinery/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,15 @@ def share(self, group, readonly=True):
logger.info("Re-index / update data set: %s", self)
DataSetIndex().update_object(self, using='core')

def unshare(self, group):
super(DataSet, self).unshare(group)
# This might be a hack but I couldn't find an easier solution to about
# the import loop. I found this solution here
# http://stackoverflow.com/a/7199514/981933
from core.search_indexes import DataSetIndex
logger.info("Re-index / update data set: %s", self)
DataSetIndex().update_object(self, using='core')


class InvestigationLink(models.Model):
data_set = models.ForeignKey(DataSet)
Expand Down

0 comments on commit d00bb44

Please sign in to comment.