Contribution helper crashes when pledge.raised is None

VERIFIED FIXED in 5.8

Status

addons.mozilla.org Graveyard
Public Pages
VERIFIED FIXED
8 years ago
2 years ago

People

(Reporter: jbalogh, Assigned: jbalogh)

Tracking

Details

(Whiteboard: [z], URL)

(Assignee)

Description

8 years ago
Traceback (most recent call last):

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/core/handlers/base.py", line 101, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/data/amo_python/www/preview/zamboni/apps/addons/views.py", line 27, in decorated
   return f(request, *args, **kwargs)

 File "/data/amo_python/www/preview/zamboni/apps/addons/views.py", line 97, in addon_detail
   return jingo.render(request, 'addons/details.html', data)

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/jingo/__init__.py", line 68, in render
   rendered = template.render(**context)

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/jinja2/environment.py", line 705, in render
   return self.environment.handle_exception(exc_info, True)

 File "/data/amo_python/www/preview/zamboni/apps/addons/templates/addons/details.html", line 1, in top-level template code
   {% extends "base.html" %}

 File "/data/amo_python/www/preview/zamboni/templates/base.html", line 59, in top-level template code
   {% block main_content %}

 File "/data/amo_python/www/preview/zamboni/templates/base.html", line 66, in block "main_content"
   {% block content %}{% endblock %}

 File "/data/amo_python/www/preview/zamboni/apps/addons/templates/addons/details.html", line 37, in block "content"
   contribution(

 File "/data/amo_python/www/preview/zamboni/apps/addons/helpers.py", line 83, in contribution
   'pledge': pledge,

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/jinja2/environment.py", line 705, in render
   return self.environment.handle_exception(exc_info, True)

 File "/data/amo_python/www/preview/zamboni/apps/addons/templates/addons/contribution.html", line 3, in top-level template code
   {% cache pledge %}

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/caching/ext.py", line 63, in _cache_support
   return caching.base.cached(caller, key, timeout)

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/caching/base.py", line 242, in cached
   val = function()

 File "/data/amo_python/www/preview/zamboni/apps/addons/templates/addons/contribution.html", line 23, in template
   data-ratio="{{ pledge.raised / pledge.target|float }}"

TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
(Assignee)

Comment 1

8 years ago
http://github.com/jbalogh/zamboni/commit/05f47af8ee769b1f23fd0866bd77abc3f0b43ecd
Assignee: fwenzel → jbalogh
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: 5.9 → 5.8
Verified FIXED on https://preview.addons.mozilla.org/z/en-US/firefox/addon/64250/.

(OMG, thanks for the tests!)
Status: RESOLVED → VERIFIED
Very nice, thanks for fixing my bug for me ;)
(Assignee)

Comment 4

8 years ago
In truth, I needed something to test so I could get us to 300.
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.