コード例 #1
0
ファイル: models.py プロジェクト: jpotts/mozillians
def update_search_index(sender, instance, **kwargs):
    if instance.is_complete:
        index_objects.delay(sender, [instance.id], public_index=False)
        if instance.is_public_indexable:
            index_objects.delay(sender, [instance.id], public_index=True)
        else:
            unindex_objects.delay(UserProfile, [instance.id], public_index=True)
コード例 #2
0
def update_search_index(sender, instance, **kwargs):
    if instance.is_complete:
        index_objects.delay(sender, [instance.id], public_index=False)
        if instance.is_public_indexable:
            index_objects.delay(sender, [instance.id], public_index=True)
        else:
            unindex_objects.delay(UserProfile, [instance.id], public_index=True)
コード例 #3
0
def delete(request):
    user = request.user
    unindex_objects.delay(UserProfile, [user.userprofile.id], public_index=False)
    unindex_objects.delay(UserProfile, [user.userprofile.id], public_index=True)
    remove_from_basket_task.delay(user.email, user.userprofile.basket_token)
    user.userprofile.anonymize()
    log.info('Deleting %d' % user.id)
    auth.logout(request)
    return redirect('phonebook:home')
コード例 #4
0
ファイル: models.py プロジェクト: jpotts/mozillians
def remove_from_search_index(sender, instance, **kwargs):
    unindex_objects.delay(UserProfile, [instance.id], public_index=False)
    unindex_objects.delay(UserProfile, [instance.id], public_index=True)
コード例 #5
0
ファイル: models.py プロジェクト: Chaasof/mozillians
def remove_from_search_index(sender, instance, **kwargs):
    unindex_objects.delay(UserProfileMappingType, [instance.id],
                          public_index=False)
    unindex_objects.delay(UserProfileMappingType, [instance.id],
                          public_index=True)