Locales with missing descriptions cause traceback in Webpay

RESOLVED FIXED in 2015-03-10

Status

Marketplace
Payments/Refunds
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: kumar, Assigned: kumar)

Tracking

Avenir
2015-03-10
x86
Mac OS X
Points:
---

Details

(Whiteboard: [qa-])

A JWT like this was causing a traceback in WebPay because some locales are missing descriptions (which should be allowed).

{
u'aud': u'marketplace-dev.allizom.org', 
u'iss': u'marketplace-dev.allizom.org', 
u'request': {
  u'name': u'Compound interest', 
  u'icons': {
    u'128': u'https://marketplace-dev-cdn.allizom.org/img/uploads/addon_icons/425/425930-128.png?modified=crushed', 
    u'32': u'https://marketplace-dev-cdn.allizom.org/img/uploads/addon_icons/425/425930-32.png?modified=crushed', 
    u'64': u'https://marketplace-dev-cdn.allizom.org/img/uploads/addon_icons/425/425930-64.png?modified=crushed', 
    u'48': u'https://marketplace-dev-cdn.allizom.org/img/uploads/addon_icons/425/425930-48.png?modified=crushed'
  }, 
  u'id': u'marketplace-dev:425930', 
  u'postbackURL': u'https://marketplace-dev.allizom.org/services/webpay/postback', 
  u'productData': u'addon_id=425930&buyer_email=kumar.mcmillan%40gmail.com&public_id=1789059e-7c1c-455d-94dd-8c02c5e37f55&application_size=156216&contrib_uuid=5c7d8bc8-2689-429f-8478-eccc0b237864', 
  u'defaultLocale': u'en-US', 
  u'pricePoint': u'5', 
  u'chargebackURL': u'https://marketplace-dev.allizom.org/services/webpay/chargeback', 
  u'locales': {
    u'fr': {
      u'description': u"Simple calculatrice d'int\xe9r\xeats compos\xe9s"}, 
    u'en-us': {
      u'description': u'Simple compound interest calculator'}, 
    u'en-US': {
      u'name': u'Compound interest'}
  }, 
  u'description': u'Simple compound interest calculator'
}, 
u'exp': 1425667134, 
u'iat': 1425663534, 
u'typ': u'mozilla-dev/payments/pay/v1'
}

http://sentry.dmz.phx1.mozilla.com/marketplace-dev/marketplace-dev-webpay/group/24862/

KeyError: 'description'

Stacktrace (most recent call last):

  File "django/core/handlers/base.py", line 113, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "newrelic/packages/wrapt/wrappers.py", line 452, in __call__
    args, kwargs)
  File "newrelic/hooks/framework_django.py", line 485, in wrapper
    return wrapped(*args, **kwargs)
  File "rest_framework/viewsets.py", line 78, in view
    return self.dispatch(request, *args, **kwargs)
  File "django/views/decorators/csrf.py", line 77, in wrapped_view
    return view_func(*args, **kwargs)
  File "rest_framework/views.py", line 399, in dispatch
    response = self.handle_exception(exc)
  File "rest_framework/views.py", line 396, in dispatch
    response = handler(request, *args, **kwargs)
  File "webpay/api/api.py", line 31, in create
    res = process_pay_req(request, data=request.DATA)
  File "webpay/pay/views.py", line 100, in process_pay_req
    _trim_pay_request(pay_req)
  File "webpay/pay/views.py", line 486, in _trim_pay_request
    d = _trim(v['description'])
Assignee: nobody → kumar.mcmillan
https://github.com/mozilla/webpay/pull/609
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
Target Milestone: --- → 2015-03-10
You need to log in before you can comment on or make changes to this bug.