fix broken default avatar when avatar service is file upload

Review Request #10692 — Created Sept. 6, 2019 and updated

cathyzhang
Review Board
release-3.0.x
4812
10690
reviewboard, students

fix broken default avatar for users when avatar service in admin is chosen as file upload

After selecting file upload as avatar service, all default avatars in user page works well

Summary Author
fix broken default avatar
cathyQinQin
Description From Last Updated

The same comments about the change description I made on your other review request apply to this change.

chipx86chipx86

This will need unit tests that prove the fixes. Tests should reproduce the original problem, fail without your fix, and …

chipx86chipx86

I mentioned this in the other review request, but avatars don't always return URLs. The main point of call is …

chipx86chipx86
cathyzhang
cathyzhang
Review request changed

Bugs:

+4812
chipx86
  1. 
      
  2. The same comments about the change description I made on your other review request apply to this change.

  3. This will need unit tests that prove the fixes. Tests should reproduce the original problem, fail without your fix, and succeed with your fix.

  4. I mentioned this in the other review request, but avatars don't always return URLs. The main point of call is render(), which should also return None if it has nothing to render. We need to make sure that that path behaves correctly.

    So, basically, AvatarService.render() in Djblets should return None if the URLs are None, and the code that calls for_user() and then render() should call the get_services_for_user() that I mentioned in the other review request and call render() on each until it gets a result.

  5. 
      
Loading...