@receiver(pre_save, sender=User)
def user_pre_save_callback(sender, **kwargs):
 user = kwargs['instance']
 user._changed_fields = get_changed_fields_dict(user, sender)

@ receiver ( pre_save , sender = User ) def user_pre_save_callback ( sender , ** kwargs ) : user = kwargs [ 'instance' ] user . _changed_fields = get_changed_fields_dict ( user , sender )
capture old fields on the user instance before save and cache them as a private field on the current model for use in the post_save callback .