<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encrypt_password(self):
 """ encrypt password if not already encrypted """

        if self.password and not self.password.startswith('$pbkdf2'):
            self.set_password(self.password)