code: def pre_save(sender, model):
      
  
      if isinstance(model, Model) and 'password' in model.dirty_fields:
          model.salt, model.password = gen_salt_and_hash(model.password)
docs: Hash the password if being changed