'Returns a boolean of whether the raw_password was correct. Handles
encryption formats behind the scenes.'

def check_password(self, raw_password):

    if ('$' not in self.password):
        is_correct = (self.password == get_hexdigest('md5', '', raw_password))
        if is_correct:
            self.set_password(raw_password)
            self.save()
        return is_correct
    return check_password(raw_password, self.password)
