diff --git a/data/model.py b/data/model.py index 80cdde416..4f44d863d 100644 --- a/data/model.py +++ b/data/model.py @@ -299,7 +299,7 @@ def get_user(username): def get_matching_teams(team_prefix, organization): query = Team.select().where(Team.name ** (team_prefix + '%'), Team.organization == organization) - return list(query.limit(10)) + return query.limit(10) def get_matching_users(username_prefix, organization=None): diff --git a/endpoints/api.py b/endpoints/api.py index 16583d4ed..bac8d10c9 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -273,6 +273,7 @@ def get_matching_entities(prefix): 'kind': 'team', 'is_org_member': True } + return result def user_view(user): user_json = { diff --git a/initdb.py b/initdb.py index cfc2f40f5..aebdbe684 100644 --- a/initdb.py +++ b/initdb.py @@ -144,6 +144,10 @@ def populate_database(): reader.verified = True reader.save() + outside_org = model.create_user('outsideorg', 'password', 'no2@thanks.com') + outside_org.verified = True + outside_org.save() + __generate_repository(new_user_1, 'simple', 'Simple repository.', False, [], (4, [], ['latest', 'prod'])) @@ -189,7 +193,8 @@ def populate_database(): org_repo = __generate_repository(org, 'orgrepo', 'Repository owned by an org.', False, - [], (4, [], ['latest', 'prod'])) + [(outside_org, 'read')], + (4, [], ['latest', 'prod'])) reader_team = model.create_team('readers', org, 'member', 'Readers of orgrepo.') diff --git a/screenshots/screenshots.js b/screenshots/screenshots.js index 09a817ed4..914192216 100644 --- a/screenshots/screenshots.js +++ b/screenshots/screenshots.js @@ -30,6 +30,7 @@ var isDebug = !!options['d']; var rootUrl = isDebug ? 'http://localhost:5000/' : 'https://quay.io/'; var repo = isDebug ? 'complex' : 'r0'; var org = isDebug ? 'buynlarge' : 'quay' +var orgrepo = 'orgrepo' var outputDir = "screenshots/"; @@ -123,4 +124,14 @@ casper.then(function() { this.capture(outputDir + 'org-admin.png'); }); +casper.thenOpen(rootUrl + 'repository/' + org + '/' + orgrepo + '/admin', function() { + this.waitForText('outsideorg') +}); + +disableOlark(); + +casper.then(function() { + this.capture(outputDir + 'org-repo-admin.png'); +}); + casper.run(); diff --git a/static/partials/repo-admin.html b/static/partials/repo-admin.html index 6c2d3e97b..4e090396f 100644 --- a/static/partials/repo-admin.html +++ b/static/partials/repo-admin.html @@ -47,7 +47,7 @@