Switch avatars to be built out of CSS and only overlayed with the gravatar when a non-default exists
This commit is contained in:
parent
2d8d0c6fd3
commit
27a9b84587
94 changed files with 663 additions and 303 deletions
|
@ -30,13 +30,15 @@ def org_view(o, teams):
|
|||
view = {
|
||||
'name': o.username,
|
||||
'email': o.email if is_admin else '',
|
||||
'avatar': avatar.compute_hash(o.email, name=o.username),
|
||||
'avatar': avatar.get_data_for_user(o),
|
||||
'is_admin': is_admin,
|
||||
'is_member': is_member
|
||||
}
|
||||
|
||||
if teams is not None:
|
||||
teams = sorted(teams, key=lambda team:team.id)
|
||||
view['teams'] = {t.name : team_view(o.username, t) for t in teams}
|
||||
view['ordered_teams'] = [team.name for team in teams]
|
||||
|
||||
if is_admin:
|
||||
view['invoice_email'] = o.invoice_email
|
||||
|
@ -301,16 +303,14 @@ class ApplicationInformation(ApiResource):
|
|||
if not application:
|
||||
raise NotFound()
|
||||
|
||||
org_hash = avatar.compute_hash(application.organization.email,
|
||||
name=application.organization.username)
|
||||
app_hash = (avatar.compute_hash(application.avatar_email, name=application.name) if
|
||||
application.avatar_email else org_hash)
|
||||
app_email = application.avatar_email or application.organization.email
|
||||
app_data = avatar.get_data(application.name, app_email, 'app')
|
||||
|
||||
return {
|
||||
'name': application.name,
|
||||
'description': application.description,
|
||||
'uri': application.application_uri,
|
||||
'avatar': app_hash,
|
||||
'avatar': app_data,
|
||||
'organization': org_view(application.organization, [])
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue