Skip to content

Commit

Permalink
add get_by_id to Organization (#3712)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omer Lachish authored and arikfr committed Apr 29, 2019
1 parent f3a653c commit 21e22a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redash/models/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def __str__(self):
def get_by_slug(cls, slug):
return cls.query.filter(cls.slug == slug).first()

@classmethod
def get_by_id(cls, _id):
return cls.query.filter(cls.id == _id).one()

@property
def default_group(self):
return self.groups.filter(Group.name == 'default', Group.type == Group.BUILTIN_GROUP).first()
Expand Down

0 comments on commit 21e22a2

Please sign in to comment.