Allow default logo_s3_key prefix in ownership check
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 26s

This commit is contained in:
vickytechkey 2026-08-12 20:17:32 +05:30
parent e93b63f988
commit 37ebcac45f

View file

@ -175,7 +175,7 @@ class ProfileView(APIView):
# Check permissions & s3 keys
logo_key = request.data.get('logo_s3_key', profile.logo_s3_key)
if logo_key and not logo_key.startswith(f"suppliers/{user.id}/"):
if logo_key and not logo_key.startswith(f"suppliers/{user.id}/") and not logo_key.startswith("suppliers/default/"):
return Response({'error': 'Invalid logo_s3_key ownership'}, status=status.HTTP_400_BAD_REQUEST)
profile.phone = request.data.get('phone', profile.phone)