Revamp avatar service registry API

Review Request #8479 — Created Oct. 20, 2016 and submitted — Latest diff uploaded

Information

Djblets
release-0.10.x

Reviewers

AvatarServices now require an AvatarSettingsManager class when
being instantiated. Previously, this was an optional argument that
defaulted to the default AvatarSettingsManager which throws
NotImplementedError for all its methods. However, registries were not
guaranteed to return any third party avatar services instantiated with
the correct settings manager.

This has been corrected by making the avatar services registry always
store instances instead. It has simplified the API as now most things
can be done via method calls with the AvatarService class as an
argument instead of its avatar_service_id attribute. It also has the
benefit of making unit tests more succinct.

The AvatarServicesRegistry's get_avatar_service, for_user, and
configurable_services nethods have been re-written to return an
instance of the requested avatar service, instantiated with the
correct settings manager class.

Unit tests & the rest of the avatar services suite have been
re-written in light of these changes.

Ran unit tests.
Tested avatar services still work with Review Board.

    Loading...