Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

move to explicit signals (bug 821773) #671

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Owner

andymckay commented Mar 15, 2013

@robhudson robhudson commented on an outdated diff Apr 1, 2013

apps/addons/models.py
@@ -42,7 +42,8 @@
import sharing.utils as sharing
from stats.models import AddonShareCountTotal
from translations.fields import (TranslatedField, PurifiedField,
- LinkifiedField, Translation)
+ LinkifiedField, Translation,
+ save_signal)
@robhudson

robhudson Apr 1, 2013

Member

This is all out of order.

@robhudson robhudson commented on an outdated diff Apr 1, 2013

apps/bandwagon/models.py
@@ -22,7 +22,7 @@
from addons.models import Addon, AddonRecommendation
from applications.models import Application
from stats.models import CollectionShareCountTotal
-from translations.fields import TranslatedField, LinkifiedField
+from translations.fields import LinkifiedField, TranslatedField, save_signal

@robhudson robhudson commented on the diff Apr 1, 2013

apps/bandwagon/models.py
@@ -376,10 +376,11 @@ def post_delete(sender, instance, **kwargs):
models.signals.post_save.connect(Collection.post_save, sender=Collection,
dispatch_uid='coll.post_save')
+models.signals.pre_save.connect(save_signal, sender=Collection,
+ dispatch_uid='coll_translations')

@robhudson robhudson commented on an outdated diff Apr 1, 2013

apps/localizers/models.py
@@ -35,3 +35,7 @@ class L10nSettings(amo.models.ModelBase):
class Meta:
db_table = 'l10n_settings'
+
+
+models.signals.pre_save.connect(save_signal, sender=L10nSettings,
+ dispatch_uid='userprofile_translations')
@robhudson

robhudson Apr 1, 2013

Member

L10nSettings and userprofile_translations? That seems bizarre.

@robhudson robhudson commented on the diff Apr 1, 2013

apps/reviews/models.py
@@ -115,8 +115,12 @@ def transformer(reviews):
user_ids[user.id].user = user
-models.signals.post_save.connect(Review.post_save, sender=Review)
-models.signals.post_delete.connect(Review.post_delete, sender=Review)
+models.signals.post_save.connect(Review.post_save, sender=Review,
+ dispatch_uid='review_post_save')

@andymckay andymckay closed this Apr 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment