def can_revert(self):
        """
        Return True if we can revert the draft version of the document to the
        currently published version.
        """

        if self.can_publish:
            with self.published_context():
                return self.count(Q._uid == self._uid) > 0

        return False