Work in progress: Start on org view
This commit is contained in:
parent
0175bd91bf
commit
ba7360f2a9
5 changed files with 17 additions and 8 deletions
|
@ -241,10 +241,13 @@ user_files = UserRequestFiles(app.config['AWS_ACCESS_KEY'],
|
|||
|
||||
@app.route('/api/organization/<orgname>', methods=['GET'])
|
||||
def get_organization(orgname):
|
||||
user = current_user.db_user()
|
||||
|
||||
def team_view(t):
|
||||
return {
|
||||
'id': t.id,
|
||||
'name': t.name
|
||||
'name': t.name,
|
||||
'is_member': False
|
||||
}
|
||||
|
||||
def org_view(o, teams):
|
||||
|
@ -257,12 +260,11 @@ def get_organization(orgname):
|
|||
if current_user.is_anonymous():
|
||||
abort(404)
|
||||
|
||||
user = current_user.db_user()
|
||||
org = model.get_organization(orgname)
|
||||
if not org:
|
||||
abort(404)
|
||||
|
||||
teams = model.get_user_teams_within_org(user.username, org)
|
||||
teams = model.get_teams_within_org(org)
|
||||
return jsonify(org_view(org, teams))
|
||||
|
||||
|
||||
|
|
Reference in a new issue