Skip to content

Commit

Permalink
Fix issue for retrieve query by uuid (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalajackus committed Aug 12, 2021
1 parent 2db3290 commit d2f78ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gateway/clients.py
Expand Up @@ -40,7 +40,13 @@ def prepare_data(self, spec: Spec, **kwargs) -> Tuple[str, str]:
if kwargs.get('pk') is None:
path = f'/{model}/'
else:
pk_name = 'uuid' if utils.valid_uuid4(pk) else 'id'
# It was checking shipment/{uuid} in API specification when pk is of uuid type,
# as TP services are mainly using
# shipment/{id}
# Commenting code to make it work for id, as TP services don't have endpoint to
# make request by uuid
# pk_name = 'uuid' if utils.valid_uuid4(pk) else 'id'
pk_name = 'id'
path_kwargs = {pk_name: pk}
path = f'/{model}/{{{pk_name}}}/'

Expand Down

0 comments on commit d2f78ef

Please sign in to comment.