@method_decorator(logged_in_or_basicauth(AUTH_REALM))
    @method_decorator(group_required(API_GROUP_NAME))  # FIXME: Should be more granular permissions
    def get(self, request, document):
        document, extension = os.path.splitext(document)
        processor = DocumentProcessor()
        document = processor.read(document, options={'revision_count': True, 'user': request.user, })
        rev_count = document.get_revision()
        if rev_count <= 0:
            log.info('RevisionCountHandler.read rev_count %s.' % str(rev_count))
            if settings.DEBUG:
                raise Exception('No document revisions')
            else:
                return Response(status=status.HTTP_400_BAD_REQUEST)
        if processor.errors:
            log.error('RevisionCountHandler.read Exception %s' % processor.errors[0])
            return Response(status=status.HTTP_400_BAD_REQUEST)
        log.info('RevisionCountHandler.read request fulfilled for document %s, extension %s' % (document, extension))
        return HttpResponse(rev_count)
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/api/views.py/RevisionCountHandler.get/original