Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions completion_aggregator/dispatch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.dispatch import Signal

AggregatorUpdate = Signal(providing_args=['aggregation_data'])
3 changes: 2 additions & 1 deletion completion_aggregator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from model_utils.models import TimeStampedModel

from .utils import get_percent, make_datetime_timezone_unaware

from .dispatch import AggregatorUpdate
User = get_user_model()

INSERT_OR_UPDATE_AGGREGATOR_QUERY = """
Expand Down Expand Up @@ -194,6 +194,7 @@ def bulk_create_or_update(self, updated_aggregators):
else:
aggregation_data = [obj.get_values() for obj in updated_aggregators]
cur.executemany(INSERT_OR_UPDATE_AGGREGATOR_QUERY, aggregation_data)
AggregatorUpdate.send(sender=self.__class__, aggregation_data=aggregation_data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't aggregation_data undefined when connection.vendor == 'sqlite'?



class Aggregator(TimeStampedModel):
Expand Down
1 change: 0 additions & 1 deletion completion_aggregator/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

log = logging.getLogger(__name__)


def register():
"""
Register signal handlers.
Expand Down