diff --git a/platypush/plugins/variable/__init__.py b/platypush/plugins/variable/__init__.py index 204fc6903..f40cc09f7 100644 --- a/platypush/plugins/variable/__init__.py +++ b/platypush/plugins/variable/__init__.py @@ -64,7 +64,11 @@ class VariablePlugin(Plugin, EntityManager): :param name: Name of the variable to remove. """ - self.publish_entities({name: None}) + with self._db.get_session() as session: + entity = session.query(Variable).filter(Variable.name == name).first() + if entity is not None: + self._entities.delete(entity.id) + self._db_vars.pop(name, None) return True