1414from rest_framework .response import Response
1515from tests .fixtures .example_bco import BCO_000001
1616from config .services import legacy_api_converter , response_constructor
17- from biocompute .services import BcoDraftSerializer
17+ from biocompute .services import BcoDraftSerializer , bco_counter_increment
1818from biocompute .selectors import retrieve_bco
1919from prefix .selectors import user_can_draft
2020
21-
2221hostname = settings .PUBLIC_HOSTNAME
2322
2423BCO_DRAFT_SCHEMA = openapi .Schema (
@@ -171,13 +170,16 @@ class DraftRetrieveApi(APIView):
171170
172171 API View to Retrieve a Draft Object
173172
174- This view allows authenticated users to retrieve the contents of a specific draft object
175- identified by its BioCompute Object (BCO) accession number. The operation ensures that
176- only users with appropriate permissions can access the draft contents.
173+ This view allows authenticated users to retrieve the contents of a specific
174+ draft object identified by its BioCompute Object (BCO) accession number.
175+ The operation ensures that only users with appropriate permissions can
176+ access the draft contents. Upo successfull retrieval of object the
177+ `access_count` is for this object is incremented.
177178
178179 Parameters:
179- - bco_accession (str): A string parameter passed in the URL path that uniquely identifies
180- the draft object to be retrieved.
180+ - bco_accession (str):
181+ A string parameter passed in the URL path that uniquely identifies the
182+ draft object to be retrieved.
181183 """
182184
183185 @swagger_auto_schema (
@@ -210,4 +212,5 @@ def get(self, request, bco_accession):
210212 data = {"message" : f"User, { requester } , does not have draft permissions" \
211213 + f" for { bco_accession } ." })
212214 else :
215+ bco_counter_increment (bco_instance )
213216 return Response (status = status .HTTP_200_OK , data = bco_instance .contents )
0 commit comments