Skip to content

Commit

Permalink
Fix bugs to allow apk download with API call
Browse files Browse the repository at this point in the history
  • Loading branch information
pnu-s committed May 2, 2020
1 parent 295fc57 commit ca2a9b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions exodus/restful_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_report_infos(request, r_id):
'apk_dl_link': '',
}
if request.user.is_staff:
obj.apk_dl_link = '/api/apk/{}/'.format(report.id)
obj['apk_dl_link'] = '/api/apk/{}/'.format(report.id)

serializer = ReportInfosSerializer(obj, many=False)
return JsonResponse(serializer.data, safe=True)
Expand All @@ -64,13 +64,13 @@ def get_apk(request, r_id):
apk_path = report.apk_file

minioClient = Minio(
settings.MINIO_URL,
access_key=settings.MINIO_ACCESS_KEY,
secret_key=settings.MINIO_SECRET_KEY,
secure=settings.MINIO_SECURE
settings.MINIO_STORAGE_ENDPOINT,
access_key=settings.MINIO_STORAGE_ACCESS_KEY,
secret_key=settings.MINIO_STORAGE_SECRET_KEY,
secure=settings.MINIO_STORAGE_USE_HTTPS
)
try:
data = minioClient.get_object(settings.MINIO_BUCKET, apk_path)
data = minioClient.get_object(settings.MINIO_STORAGE_MEDIA_BUCKET_NAME, apk_path)
return HttpResponse(
data.data, content_type=data.getheader('Content-Type'))
except Exception as err:
Expand Down

0 comments on commit ca2a9b8

Please sign in to comment.