Fix KeyErrors when saving the Avatar Settings form.

Review Request #9404 — Created Nov. 27, 2017 and submitted

Christian Hammond
Review Board

The Avatar Settings form's clean_default_service() method attempted to
access cleaned data for other fields. Whether or not this works depends
on the order in which the Form class attempts to clean fields, and
broke in some manual testing I was performing, raising KeyErrors.

This switches this method to be a clean() method, allowing it to
operate on cleaned data from multiple fields and ensuring that saving
never breaks.

Saved the form many times without hitting these crashes.

Unit tests pass.

David Trowbridge
  1. Ship It!
Christian Hammond
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (a37a3fe)