Skip to content

Commit

Permalink
Merge pull request #262 from TACC/bug/FP-1099--504-error-on-large-pub…
Browse files Browse the repository at this point in the history
…lish

bug/FP-1099: Only rebuild index on `Page` type for `publish` or `unpublish` events
  • Loading branch information
rstijerina authored Jul 1, 2021
2 parents a0104d4 + 528662e commit 435302a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion taccsite_cms/signal_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.db import models
from django.core.management import call_command
from cms import signals
from cms.models.pagemodel import Page


class RealtimeSignalProcessor(BaseSignalProcessor):
Expand All @@ -28,4 +29,5 @@ def teardown(self):
models.signals.post_delete.disconnect(self.handle_save)

def handle_save(self, **kwargs):
call_command('rebuild_index', '--noinput')
if type(kwargs.get('instance')) is Page:
call_command('rebuild_index', '--noinput')

0 comments on commit 435302a

Please sign in to comment.