diff --git a/auth/scopes.py b/auth/scopes.py index c71e5faa7..b92f9278e 100644 --- a/auth/scopes.py +++ b/auth/scopes.py @@ -76,7 +76,7 @@ IMPLIED_SCOPES = { def scopes_from_scope_string(scopes): if not scopes: - return {} + scopes = '' return {ALL_SCOPES.get(scope, None) for scope in scopes.split(',')} diff --git a/avatars/avatars.py b/avatars/avatars.py index 386b5fc57..40935df10 100644 --- a/avatars/avatars.py +++ b/avatars/avatars.py @@ -35,6 +35,7 @@ class BaseAvatar(object): class GravatarAvatar(BaseAvatar): """ Avatar system that uses gravatar for generating avatars. """ def compute_hash(self, email, name=None): + email = email or "" return hashlib.md5(email.strip().lower()).hexdigest() def get_url(self, email, size=16, name=None): @@ -45,6 +46,7 @@ class GravatarAvatar(BaseAvatar): class LocalAvatar(BaseAvatar): """ Avatar system that uses the local system for generating avatars. """ def compute_hash(self, email, name=None): + email = email or "" if not name and not email: return '' diff --git a/endpoints/web.py b/endpoints/web.py index 4a1205108..e297074ff 100644 --- a/endpoints/web.py +++ b/endpoints/web.py @@ -184,7 +184,7 @@ def status(): @app.route("/avatar/") -def avatar(avatar_hash): +def render_avatar(avatar_hash): try: size = int(request.args.get('size', 16)) except ValueError: @@ -424,10 +424,11 @@ def request_authorization_code(): 'name': oauth_app.name, 'description': oauth_app.description, 'url': oauth_app.application_uri, + 'avatar': avatar.compute_hash(oauth_app.avatar_email, name=oauth_app.name), 'organization': { 'name': oauth_app.organization.username, 'avatar': avatar.compute_hash(oauth_app.organization.email, - name=oauth_app.organization.name) + name=oauth_app.organization.username) } } diff --git a/static/css/quay.css b/static/css/quay.css index 9213bb575..9d7568f97 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -4256,9 +4256,10 @@ pre.command:before { display: block !important; } -.auth-header > img { +.auth-header > .avatar { float: left; - margin-top: 8px; + display: inline-block; + margin-top: 12px; margin-right: 20px; } diff --git a/static/partials/manage-application.html b/static/partials/manage-application.html index 266a61e6e..c9e084b39 100644 --- a/static/partials/manage-application.html +++ b/static/partials/manage-application.html @@ -7,8 +7,8 @@
-

- {{ application.name || '(Untitled)' }}

+ +

{{ application.name || '(Untitled)' }}

{{ organization.name }} @@ -99,7 +99,8 @@

- Note: The generated token will act on behalf of user + Note: The generated token will act on behalf of user + {{ user.username }}
diff --git a/templates/oauthorize.html b/templates/oauthorize.html index 19bde633b..567547f6f 100644 --- a/templates/oauthorize.html +++ b/templates/oauthorize.html @@ -13,10 +13,10 @@
- +

{{ application.name }}

- {{ application.organization.name }}