Fixes: 1) Correct UUID decoding to resolve invalid usage of urlsafe_base64_decode.

Extra: Removed unnecessary variable assignments for cleaner code.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-08-13 19:56:08 +03:00
parent 5d8f528dfd
commit e7bfa87e74

View file

@ -468,9 +468,7 @@ def download_digital_asset_view(request, *args, **kwargs):
a JsonResponse with an error message if an error occurs during the process.
"""
try:
uuid_bytes = urlsafe_base64_decode(str(kwargs.get("encoded_uuid")))
uuid = str(uuid_module.UUID(bytes=uuid_bytes))
uuid = urlsafe_base64_decode(str(kwargs.get("encoded_uuid"))).decode("utf-8")
download = DigitalAssetDownload.objects.get(order_product__uuid=uuid)