Skip to content

Commit

Permalink
Add 'manage.py org list' command
Browse files Browse the repository at this point in the history
'org list' simply prints out the organizations.
  • Loading branch information
adamlwgriffiths committed Jul 11, 2016
1 parent b1937aa commit 99906c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions redash/cli/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,14 @@ def set_google_apps_domains(domains):
def show_google_apps_domains():
organization = models.Organization.select().first()
print "Current list of Google Apps domains: {}".format(organization.google_apps_domains)


@manager.command
def list():
"""List all organizations"""
orgs = models.Organization.select()
for i, org in enumerate(orgs):
if i > 0:
print "-" * 20

print "Id: {}\nName: {}\nSlug: {}".format(org.id, org.name, org.slug)

0 comments on commit 99906c1

Please sign in to comment.