Fix a couple problems with the related user widget and avatars.

Review Request #1200 — Created May 2, 2018 and updated

guest5830
Review Board
fc7783d...
demo
The related-user widget had two problems when dealing with avatars: one
on the server side, and one on the client.

On the server, if no avatar services were available for a user, we'd get
an uncaught `AttributeError` when trying to get the
`get_avatar_urls_uncached` method on a `NoneType`. On the client, once
we'd discovered a user without any avatars, we'd neglect to add a blank
`avatarURL` field to the data for the widget, resulting in a JavaScript
error.

Testing done:
Set the default avatar service to "None" and added an avatar-less user
to a group. Loaded that group in the admin UI and saw that I could see
the page, including the users widget, without any Python or JavaScript
errors.

Reviewed at https://reviews.reviewboard.org/r/9896/


  • 2
  • 0
  • 0
  • 0
  • 2
Description From Last Updated
test guest7453 guest7453
I don't like it! Basically, I just don't like this change. guest7935 guest7935
guest4822
  1. Ship It!
  2. 
      
guest7935
  1. 
      
  2. reviewboard/admin/form_widgets.py (Diff revision 1)
     
     

    I don't like it!

    Basically, I just don't like this change.

  3. 
      
guest7453
  1. 
      
  2. reviewboard/admin/form_widgets.py (Diff revision 1)
     
     
  3. 
      
Loading...