flake8
-
djblets/avatars/services/fallback.py (Diff revision 1) Show all issues
Review Request #10443 — Created March 12, 2019 and submitted
Information | |
---|---|
chipx86 | |
Djblets | |
release-1.0.x | |
Reviewers | |
djblets | |
With the existing avatar implementation, users that don't have a usable
avatar service (such as when Gravatars are used but the user has opted
out) would result in an empty space where the avatar would otherwise go.
This could lead to display inconsistencies, unwanted logging, or other
problems.This change adds a new avatar service that's used as a fallback when no
other service is available. This will show the first two letters of the
username, overlayed on top of a colored background. The background color
is based on the username, helping to provide different visuals for
different users.Consumers can replace the fallback with some other service by overriding
fallback_service_class
on the registry.To help with styling, both the existing avatars and the new ones have
new namespaced CSS classes (.djblets-o-avatar
), which are meant to
replace the.avatar
class (though this is still used).
Unit tests pass.
Tested various avatar sizes, making sure the fonts are in proportion.
Summary | |
---|---|
Description | From | Last Updated |
---|---|---|
From the comments it looks like your intent was to use the initials if the user has first and last … |
|
|
W391 blank line at end of file |
![]() |
|
Can we use the full name if it exists? |
|
|
W391 blank line at end of file |
![]() |
|
These don't impact the result now that it's definitely username-only, so they can be removed. |
|
djblets/avatars/services/fallback.py (Diff revision 1) |
---|
From the comments it looks like your intent was to use the initials if the user has first and last names defined, but you don't do that here. Can we?
djblets/avatars/templates/avatars/fallback.html (Diff revision 1) |
---|
Can we use the full name if it exists?
Fixed the description of
FallbackService
to not incorrectly claim that the user's full name's initials are used.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+404 -12) |
Removed the fallback from the registered service list. It now exists outside it, meaning it will no longer show up in any lists of available services, and will truly exist as a fallback.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+406 -10) |
djblets/avatars/services/fallback.py (Diff revision 3) |
---|
These don't impact the result now that it's definitely username-only, so they can be removed.
Fixed the ETag to not factor in the first/last name.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+396 -10) |