code: def disable_wrapper(cls, disable, new_class):
          
          def _wrapped(self, *args, **kwargs):
              if not self.enabled:
                  raise AssertionError('Module %s is already disabled'
                                       % self.verbose_name)
  
              logger.info("Disabling %s module" % self.verbose_name)
              pre_disable.send(sender=self)
              res = disable(self, *args, **kwargs)
  
              # Unregister interfaces (if present)
              if isinstance(self, DropletInterface):
                  self.unregister()
  
              post_disable.send(sender=self)
  
              info = self._info
              info.status = ModuleInfo.DISABLED
              info.save()
  
              logger.info("Disabled %s module" % self.verbose_name)
              return res
  
          return _wrapped
docs: Wrap the disable method to call pre and post disable signals and update
          module status