No longer require an HttpRequest for avatars

Review Request #8165 — Created May 16, 2016 and submitted

Information

Djblets
release-0.10.x
25d8d42...

Reviewers

Avatar services no longer require an HttpRequest to get the uncached
avatar URLs for a user. Previously, the Gravatar avatar service used the
HttpRequest to determine whether or not HTTPS should be used for the
resulting URL. Now, we always use an HTTPS url as there is no reason not
to.

The unit tests have been udpated to reflect these changes.

Ran unit tests.

Description From Last Updated

This is going to break backwards-compatibility. We We should keep the parameter btu work without it, make it None by …

chipx86chipx86

Should say "optional".

chipx86chipx86

Typo.

chipx86chipx86

No opening paren here.

chipx86chipx86

Should specify "optional."

chipx86chipx86

Should specify if this is in pixels.

chipx86chipx86

Typo.

chipx86chipx86

No opening paren.

chipx86chipx86

Should specify optional.

chipx86chipx86

Should specify that this is in pixels.

chipx86chipx86

Can we put parens around the computation? It'll help a bit with readability.

chipx86chipx86

Missing "optional".

chipx86chipx86

We can start the string on the warn( line. It's only one more space.

chipx86chipx86

Let's reference the argument name, like: 'The "email" argument cannot be None.' Might be worth just checking for truthiness, and …

chipx86chipx86

Missing "optional".

chipx86chipx86

Same comments as above.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/gravatars/templatetags/tests.py
        djblets/avatars/services/gravatar.py
        djblets/avatars/services/base.py
        djblets/gravatars/templatetags/gravatars.py
        djblets/avatars/tests.py
        djblets/gravatars/__init__.py
    
    Ignored Files:
        docs/djblets/guides/avatars/writing-avatar-services.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/gravatars/templatetags/tests.py
        djblets/avatars/services/gravatar.py
        djblets/avatars/services/base.py
        djblets/gravatars/templatetags/gravatars.py
        djblets/avatars/tests.py
        djblets/gravatars/__init__.py
    
    Ignored Files:
        docs/djblets/guides/avatars/writing-avatar-services.rst
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. djblets/gravatars/__init__.py (Diff revision 1)
     
     

    This is going to break backwards-compatibility. We We should keep the parameter btu work without it, make it None by default.

    1. Same with the other functions below.

    2. Maybe not make it None, because that impacts the other parameters... Kind of a crumby situation. We'll just have to take the request, allow it to be None, and really just ignore it :/

    3. I think what we do is make them all None, document that the arguments should be provided as keyword arguments, and raise a ValueError if the e-mail address isn't provided.

    4. This API hasn't officially shipped yet. Do we really care enough about backwards compatibility to jump through these hoops?

    5. These gravatar functions have. They're used in RB 1.7+.

  3. 
      
chipx86
  1. 
      
  2. djblets/gravatars/__init__.py (Diff revision 1)
     
     

    Should say "optional".

  3. No opening paren here.

  4. Should specify "optional."

  5. Should specify if this is in pixels.

  6. No opening paren.

  7. Should specify optional.

  8. Should specify that this is in pixels.

  9. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/gravatars/templatetags/tests.py
        djblets/avatars/services/gravatar.py
        djblets/avatars/services/base.py
        djblets/gravatars/templatetags/gravatars.py
        djblets/avatars/tests.py
        djblets/gravatars/__init__.py
    
    Ignored Files:
        docs/djblets/guides/avatars/writing-avatar-services.rst
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/gravatars/templatetags/tests.py
        djblets/avatars/services/gravatar.py
        djblets/avatars/services/base.py
        djblets/gravatars/templatetags/gravatars.py
        djblets/avatars/tests.py
        djblets/gravatars/__init__.py
    
    Ignored Files:
        docs/djblets/guides/avatars/writing-avatar-services.rst
    
    
  2. 
      
chipx86
  1. 
      
  2. djblets/avatars/services/gravatar.py (Diff revision 2)
     
     

    Can we put parens around the computation? It'll help a bit with readability.

  3. djblets/gravatars/__init__.py (Diff revision 2)
     
     

    Missing "optional".

    1. We dont actually have a fork of Napoleon that supports this syntax. I'd rather have it in the description of the argument, or use Optional[int].

    2. We're using it everywhere else, though. Consistency is good right now. The fork will support it.

  4. djblets/gravatars/__init__.py (Diff revision 2)
     
     
     
     
     
     

    We can start the string on the warn( line. It's only one more space.

  5. djblets/gravatars/__init__.py (Diff revision 2)
     
     

    Let's reference the argument name, like: 'The "email" argument cannot be None.'

    Might be worth just checking for truthiness, and saying "cannot be None or an empty string."

  6. djblets/gravatars/__init__.py (Diff revision 2)
     
     

    Missing "optional".

  7. djblets/gravatars/__init__.py (Diff revision 2)
     
     
     
     
     
     
     
     
     

    Same comments as above.

  8. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/gravatars/templatetags/tests.py
        djblets/avatars/services/gravatar.py
        djblets/avatars/services/base.py
        djblets/gravatars/templatetags/gravatars.py
        djblets/avatars/tests.py
        djblets/gravatars/__init__.py
    
    Ignored Files:
        docs/djblets/guides/avatars/writing-avatar-services.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/gravatars/templatetags/tests.py
        djblets/avatars/services/gravatar.py
        djblets/avatars/services/base.py
        djblets/gravatars/templatetags/gravatars.py
        djblets/avatars/tests.py
        djblets/gravatars/__init__.py
    
    Ignored Files:
        docs/djblets/guides/avatars/writing-avatar-services.rst
    
    
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (dd36743)
Loading...