Mercurial > public > sg101
comparison gpp/bio/signals.py @ 562:98b373ca09f3
For bitbucket issue #3, ensure that changes to Profile, Post & Topic models
via the admin cause the search index to be updated.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 08 Feb 2012 18:58:57 -0600 |
parents | d83296cac940 |
children |
comparison
equal
deleted
inserted
replaced
561:8f3b7f0d4d13 | 562:98b373ca09f3 |
---|---|
4 """ | 4 """ |
5 from django.db.models.signals import post_save | 5 from django.db.models.signals import post_save |
6 from django.contrib.auth.models import User | 6 from django.contrib.auth.models import User |
7 import django.dispatch | 7 import django.dispatch |
8 | 8 |
9 import bio.badges | |
10 from bio.models import UserProfile | |
11 from donations.models import Donation | 9 from donations.models import Donation |
12 from weblinks.models import Link | 10 from weblinks.models import Link |
13 from downloads.models import Download | 11 from downloads.models import Download |
14 from news.models import Story | 12 from news.models import Story |
15 from potd.models import Photo | 13 from potd.models import Photo |
23 | 21 |
24 """ | 22 """ |
25 created = kwargs['created'] | 23 created = kwargs['created'] |
26 if created: | 24 if created: |
27 user = kwargs['instance'] | 25 user = kwargs['instance'] |
28 profile = bio.models.UserProfile() | 26 profile = UserProfile() |
29 profile.user = user | 27 profile.user = user |
30 profile.save() | 28 profile.save() |
31 | 29 |
32 | 30 |
33 def on_donation_save(sender, **kwargs): | 31 def on_donation_save(sender, **kwargs): |
107 """ | 105 """ |
108 Convenience function to send the profile content update signal. | 106 Convenience function to send the profile content update signal. |
109 | 107 |
110 """ | 108 """ |
111 profile_content_update.send_robust(profile) | 109 profile_content_update.send_robust(profile) |
110 | |
111 | |
112 # To avoid circular imports | |
113 import bio.badges | |
114 from bio.models import UserProfile |