[basket] When a user attempts to unsubscribe from all newsletters, it fails.

RESOLVED FIXED

Status

www.mozilla.org
Newsletters
--
critical
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: pmac, Assigned: pmac)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Sentry just told us of an exception when the method is SET, meaning they're updating their record (not directly subscribing or unsubscribing) and they've deselected all newsletters. This caused a problem because "" isn't a valid newsletter name, and threw the following exception.

---------------
KeyError: u''

Stacktrace (most recent call last):

  File "celery/execute/trace.py", line 181, in trace_task
    R = retval = fun(*args, **kwargs)
  File "news/tasks.py", line 102, in wrapped
    @wraps(func)
  File "news/tasks.py", line 209, in update_user
    'source_url': 'SOURCE_URL',
  File "news/tasks.py", line 133, in parse_newsletters
    def parse_newsletters(record, type, newsletters):
  File "news/newsletters.py", line 59, in newsletter_field
    return _newsletters()['by_name'][name].vendor_id
----------------

This has been fixed in https://github.com/mozilla/basket/commit/cc08171f9d5f31e3097964a6442e326d1b99abcc and is awaiting deployment in bug 867584.
Depends on: 867584
Blocks: 864916
Resolved!
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.