Closed Bug 1006016 Opened 11 years ago Closed 11 years ago

[dev] /sl/dashboard throws TypeError: not all arguments converted during string formatting

Categories

(Firefox Affiliates Graveyard :: affiliates.mozilla.org, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mbrandt, Assigned: osmose)

References

()

Details

/sl/dashboard/ throws a type error Steps to reproduce: 1. login and goto https://affiliates-dev.allizom.org/sl/dashboard/ Actual: Traceback (most recent call last): File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/core/handlers/base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/contrib/auth/decorators.py", line 25, in _wrapped_view return view_func(request, *args, **kwargs) File "/data/www/affiliates-dev.allizom.org/affiliates-app/affiliates/base/views.py", line 51, in dashboard 'links': request.user.link_set.order_by('-created'), File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/shortcuts/__init__.py", line 53, in render return HttpResponse(loader.render_to_string(*args, **kwargs), File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/template/loader.py", line 177, in render_to_string return t.render(context_instance) File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/src/jingo/jingo/__init__.py", line 195, in render return super(Template, self).render(context_dict) File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render return self.environment.handle_exception(exc_info, True) File "/data/www/affiliates-dev.allizom.org/affiliates-app/affiliates/base/templates/base/dashboard.html", line 14, in top-level template code {% set title = _('Dashboard') %} File "/data/www/affiliates-dev.allizom.org/affiliates-app/affiliates/base/templates/base/base.html", line 89, in top-level template code {% block content %}{% endblock %} File "/data/www/affiliates-dev.allizom.org/affiliates-app/affiliates/base/templates/base/dashboard.html", line 27, in block "content" {{ stats_list(request.user) }} File "/data/www/affiliates-dev.allizom.org/affiliates-app/affiliates/base/templates/base/macros.html", line 73, in template {% trans count=user.link_set.count()|babel_number %} File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/src/tower/tower/__init__.py", line 41, in ungettext ret = django_nugettext(singular, plural, number) File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/utils/translation/__init__.py", line 74, in ungettext return _trans.ungettext(singular, plural, number) File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/utils/translation/trans_real.py", line 323, in ungettext return do_ntranslate(singular, plural, number, 'ungettext') File "/data/www/affiliates-dev.allizom.org/affiliates-app/vendor/lib/python/django/utils/translation/trans_real.py", line 300, in do_ntranslate return getattr(t, translation_function)(singular, plural, number) File "/usr/lib64/python2.6/gettext.py", line 411, in ungettext tmsg = self._catalog[(msgid1, self.plural(n))] File "<string>", line 1, in <lambda> TypeError: not all arguments converted during string formatting
Turns out the issue was that we were passing a string to a pluralized translation function instead of an integer. This has been fixed by https://github.com/mozilla/affiliates/commit/94508e1c4da40c3e33f7b7382850dddf520c4b00 and I've pushed the fix to the dev server, which appears to be working now: https://affiliates-dev.allizom.org/sl/dashboard/
Assignee: nobody → mkelly
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
QA verified on dev - /sl/ works fantastically. Thanks for chasing this down mkelly
Status: RESOLVED → VERIFIED
Product: Firefox Affiliates → Firefox Affiliates Graveyard
You need to log in before you can comment on or make changes to this bug.