def METHOD_NAME(self, value):
    if value:
        try:
            self._password = FERNET.encrypt(bytes(value, "utf-8")).decode()
            self.is_encrypted = True
        except NameError:
            self._password = value
            self.is_encrypted = False