@method_decorator(logged_in_or_basicauth(AUTH_REALM))
    @method_decorator(group_required(API_GROUP_NAME))
    def post(self, request, code, suggested_format=None):
        if 'file' in request.FILES:
            uploaded_file = request.FILES['file']
        else:
            return Response(status=status.HTTP_400_BAD_REQUEST)
        processor = DocumentProcessor()
        options = {
            'user': request.user,
            'barcode': code,
        }
        if uploaded_file.size == 0:
            return Response(status=status.HTTP_400_BAD_REQUEST)
        document = processor.create(uploaded_file, options)
        if len(processor.errors) > 0:
            log.error('OldFileHandler.create errors: %s' % processor.errors)
            error = processor.errors[0]
            if error.__class__.__name__ in ['unicode', 'str']:
                return Response(status=status.HTTP_400_BAD_REQUEST)
            if error.code == 409:
                new_processor = DocumentProcessor()
                options['update_file'] = uploaded_file
                document = new_processor.update(code, options)
                if len(new_processor.errors) > 0:
                    return Response(status=status.HTTP_400_BAD_REQUEST)
        log.info('OldFileHandler.create request fulfilled for %s' + document.get_filename())
        return Response(document.get_filename(), status=status.HTTP_200_OK)
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/api/views.py/OldFileHandler.post/operator `%` -> `+`