<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pre_save(sender, model):
 """ Hash the password if being changed """


    if isinstance(model, Model) and 'password' in model.dirty_fields:
        model.salt, model.password = gen_salt_and_hash(model.password)