Closed Bug 554149 Opened 15 years ago Closed 15 years ago

Contribution helper crashes when pledge.raised is None

Categories

(addons.mozilla.org Graveyard :: Public Pages, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jbalogh, Assigned: jbalogh)

References

()

Details

(Whiteboard: [z])

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: fwenzel → jbalogh
Status: NEW → RESOLVED
Closed: 15 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 ;)
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.