Fix some issues with avatar services
Review Request #8257 — Created June 22, 2016 and submitted
The avatar services code has been cleaned up. Docstrings have been
touched up so that they now document all parameters and do not document
unnecessary ones. TheRB.ReviewReplyEditorView
now renders the avatar
with asrcset=
attribute instead of thedata-at2x
attribute, which
is no longer used. Finally, a new template tag,{% avatar_urls %}
, has
been introduced to serialize all avatar URLs for a given user and
requsested size to a Javascript object. This preventsKeyError
s from
being raised when avatar services only provide1x
resolution avatars,
as well as provides all additional resolutions that they can provide.
(Previously, we were hardcoding1x
and2x
resolutions.)
- Able to use an avatar service (the file upload avatar service, in this
case) that only provides1x
resolution avatars. - Ran unit tests.
Description | From | Last Updated |
---|---|---|
Did you test this? It seems odd to me to be returning this given that this is an inclusion tag. |
david | |
Hmm, actually. Is it really worth rendering a whole new template for this instead of just returning json.dumps(urls) as a … |
david | |
'six' imported but unused |
reviewbot | |
'escapejs' imported but unused |
reviewbot | |
Shouldn't this be from django.utils import six? |
david | |
This looks like it will have an extra closing brace in the javascript and an extra > in the HTML. |
david |
- Change Summary:
-
Added unit tests.
- Commit:
-
2918d76a31a21f297cf4868925fac5cecf7098f281b327eb929cdd5ea764106ed0bb40bc8cc89e03
-
Tool: PEP8 Style Checker Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html reviewboard/templates/avatars/urls.js Tool: Pyflakes Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html reviewboard/templates/avatars/urls.js
-
Tool: PEP8 Style Checker Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html Tool: Pyflakes Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html
-
-
-
Tool: PEP8 Style Checker Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html Tool: Pyflakes Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html
-
Tool: Pyflakes Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html Tool: PEP8 Style Checker Processed Files: reviewboard/avatars/templatetags/avatars.py reviewboard/avatars/templatetags/tests.py reviewboard/avatars/settings.py Ignored Files: reviewboard/static/rb/js/views/reviewReplyEditorView.js reviewboard/templates/base.html