def avoid_multiple_update(func):
    """Decorator to prevent handlers to update multiple times."""
    def wrapper(self, attr, old, new):
        if self.in_update:
            return

        self.in_update = True
        func(self, attr, old, new)
        self.in_update = False
    return wrapper