Remove a TODO and make sure a user is part of an org to get access to typeahead information for an org.
This commit is contained in:
parent
6aeac247fa
commit
c1b246c3b5
1 changed files with 8 additions and 9 deletions
|
@ -202,14 +202,15 @@ def get_matching_entities(prefix):
|
||||||
organization_name = request.args.get('organization', None)
|
organization_name = request.args.get('organization', None)
|
||||||
organization = None
|
organization = None
|
||||||
if organization_name:
|
if organization_name:
|
||||||
try:
|
permission = OrganizationMemberPermission(organization_name)
|
||||||
organization = model.get_organization(organization_name)
|
if permission.can():
|
||||||
except:
|
try:
|
||||||
pass
|
organization = model.get_organization(organization_name)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
if organization:
|
if organization:
|
||||||
# TODO: ensure that the user has access to the organization
|
teams = model.get_matching_teams(prefix, organization)
|
||||||
teams = model.get_matching_teams(prefix, organization)
|
|
||||||
|
|
||||||
users = model.get_matching_users(prefix, organization)
|
users = model.get_matching_users(prefix, organization)
|
||||||
|
|
||||||
|
@ -221,8 +222,6 @@ def get_matching_entities(prefix):
|
||||||
}
|
}
|
||||||
|
|
||||||
def user_view(user):
|
def user_view(user):
|
||||||
# TODO: Return whether the user is outside the organization (if one is
|
|
||||||
# specified)
|
|
||||||
return {
|
return {
|
||||||
'name': user.username,
|
'name': user.username,
|
||||||
'kind': 'user',
|
'kind': 'user',
|
||||||
|
|
Reference in a new issue