ponyriders / django-amazon-price-monitor

Monitors prices of Amazon products via Product Advertising API
Other
156 stars 36 forks source link

djangorestframework 3.2 compatibility #86

Closed dArignac closed 8 years ago

dArignac commented 8 years ago

Frontend does not work with current version of djangorestframework (3.2.x):

Traceback:

File "/var/www/amp/.env/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  174.                     response = self.process_exception_by_middleware(e, request)

File "/var/www/amp/.env/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  172.                     response = response.render()

File "/var/www/amp/.env/lib/python3.4/site-packages/django/template/response.py" in render
  160.             self.content = self.rendered_content

File "/var/www/amp/.env/lib/python3.4/site-packages/rest_framework/response.py" in rendered_content
  71.         ret = renderer.render(self.data, media_type, context)

File "/var/www/amp/.env/lib/python3.4/site-packages/price_monitor/api/renderers/PriceChartPNGRenderer.py" in render
  59.         cache_key = self.create_cache_key(data, sanitized_args)

File "/var/www/amp/.env/lib/python3.4/site-packages/price_monitor/api/renderers/PriceChartPNGRenderer.py" in create_cache_key
  108.         hash_data = str(data['results']).encode('utf-8')

Exception Type: TypeError at /api/products/undefined/prices/
Exception Value: list indices must be integers, not str
Request information:
GET:
spacing = '16'
margin = '7'
show_legend = 'false'
width = '1140'
no_data_font_size = '10'
show_minor_y_labels = 'true'
y_labels_major_count = '5'
height = '200'
mmrose commented 8 years ago

DRF dependency is now >=3.3