def unpublish(self, dry_run=False):
    '\n        unpublish models by deleting public model\n        '
    if self.is_public:
        raise UnpublishException('Cannot unpublish a public model - unpublish should be called from draft model')
    if (self.pk is None):
        raise UnpublishException('Please save the model before unpublishing')
    public_model = self.public
    if (public_model and (not dry_run)):
        self.public = None
        self.save()
        public_model.delete(mark_for_deletion=False)
    return public_model
unpublish models by deleting public model
def unpublish(self, dry_run=False):
    '\n        \n        '
    if self.is_public:
        raise UnpublishException('Cannot unpublish a public model - unpublish should be called from draft model')
    if (self.pk is None):
        raise UnpublishException('Please save the model before unpublishing')
    public_model = self.public
    if (public_model and (not dry_run)):
        self.public = None
        self.save()
        public_model.delete(mark_for_deletion=False)
    return public_model