Switch avatars to be built out of CSS and only overlayed with the gravatar when a non-default exists

This commit is contained in:
Joseph Schorr 2015-03-30 17:55:04 -04:00
parent 2d8d0c6fd3
commit 27a9b84587
94 changed files with 663 additions and 303 deletions

View file

@ -35,7 +35,7 @@ def user_view(user):
admin_org = AdministerOrganizationPermission(o.username)
return {
'name': o.username,
'avatar': avatar.compute_hash(o.email, name=o.username),
'avatar': avatar.get_data_for_org(o),
'is_org_admin': admin_org.can(),
'can_create_repo': admin_org.can() or CreateRepositoryPermission(o.username).can(),
'preferred_namespace': not (o.stripe_id is None)
@ -61,7 +61,7 @@ def user_view(user):
'verified': user.verified,
'anonymous': False,
'username': user.username,
'avatar': avatar.compute_hash(user.email, name=user.username),
'avatar': avatar.get_data_for_user(user)
}
user_admin = UserAdminPermission(user.username)
@ -621,17 +621,16 @@ class UserNotification(ApiResource):
def authorization_view(access_token):
oauth_app = access_token.application
app_email = oauth_app.avatar_email or oauth_app.organization.email
return {
'application': {
'name': oauth_app.name,
'description': oauth_app.description,
'url': oauth_app.application_uri,
'avatar': avatar.compute_hash(oauth_app.avatar_email or oauth_app.organization.email,
name=oauth_app.name),
'avatar': avatar.get_data(oauth_app.name, app_email, 'app'),
'organization': {
'name': oauth_app.organization.username,
'avatar': avatar.compute_hash(oauth_app.organization.email,
name=oauth_app.organization.username)
'avatar': avatar.get_data_for_org(oauth_app.organization)
}
},
'scopes': scopes.get_scope_information(access_token.scope),