Make an HttpRequest optional when rendering avatars or fetching URLs.

Review Request #10515 — Created April 4, 2019 and submitted

Information

Djblets
release-1.0.x

Reviewers

Avatar rendering and URL fetching currently takes a request, but this
prevents avatars from being used if rendering outside HTTP requests or
in places where the request is not available (such as in form widgets).

This change makes these arguments optional. Avatar implementations must
take care to respect this, checking if a request is None before
accessing it, and falling back in some manner if needed.

Unit tests pass.

Tested manually (with some changes in Review Board) and verified that
different avatars rendered without having a request present.

Summary ID
Make an HttpRequest optional when rendering avatars or fetching URLs.
Avatar rendering and URL fetching currently takes a request, but this prevents avatars from being used if rendering outside HTTP requests or in places where the request is not available (such as in form widgets). This change makes these arguments optional. Avatar implementations must take care to respect this, checking if a request is `None` before accessing it, and falling back in some manner if needed.
876d8519fcb3dac114b461b977ea3899a8395f8b
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.0.x (c5b2160)