code: def enable_wrapper(cls, enable, new_class):
          
          def _wrapped(self, *args, **kwargs):
              if not self.installed:
                  raise AssertionError('Module %s cannot be enabled'
                                       ', you should install it first'
                                       % self.verbose_name)
  
              if self.enabled:
                  raise AssertionError('Module %s is already enabled'
                                       % self.verbose_name)
  
              logger.info("Enabling %s module" % self.verbose_name)
              pre_enable.send(sender=self)
              res = enable(self, *args, **kwargs)
  
              # Register interfaces (if present)
              if isinstance(self, DropletInterface):
                  self.register()
  
              post_enable.send(sender=self)
  
              info = self._info
              info.status = ModuleInfo.ENABLED
              info.save()
  
              logger.info("Enabled %s module" % self.verbose_name)
              return res
  
          return _wrapped
docs: Wrap the enable method to call pre and post enable signals and update
          module status