def user_pre_save(sender, instance, **kw):
 if instance.id:
  user = User.objects.get(id=instance.id)
  if (user.username != instance.username):
   questions = Question.objects.filter((Q(creator=instance) | Q(answers__creator=instance))).only('id').distinct()
   for q in questions:
    q.index_later()

def user_pre_save ( sender , instance , ** kw ) : if instance . id : user = User . objects . get ( id = instance . id ) if ( user . username != instance . username ) : questions = Question . objects . filter ( ( Q ( creator = instance ) | Q ( answers__creator = instance ) ) ) . only ( 'id' ) . distinct ( ) for q in questions : q . index_later ( )
when a users username is changed .