Let the API "rawbytes" response be just that, w/ no file

This commit is contained in:
Lance Edgar 2023-01-14 10:31:31 -06:00
parent e82e27acd7
commit dec0ebba30

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar # Copyright © 2010-2023 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -479,13 +479,16 @@ class APIMasterView(APIView):
""" """
obj = self.get_object() obj = self.get_object()
filename = self.request.GET.get('filename', None) # TODO: is this really needed?
if not filename: # filename = self.request.GET.get('filename', None)
raise self.notfound() # if filename:
path = self.download_path(obj, filename) # path = self.download_path(obj, filename)
# return self.file_response(path, attachment=False)
response = self.file_response(path, attachment=False) return self.rawbytes_response(obj)
return response
def rawbytes_response(self, obj):
raise NotImplementedError
############################## ##############################
# autocomplete # autocomplete