Skip to content

Commit

Permalink
Add get_invitation method to get an invite by its unique ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtgay committed Jul 16, 2013
1 parent a9ccdc8 commit 585b39e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tahrir_api/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,20 @@ def get_all_invitations(self):

return self.session.query(Invitation)

def get_invitation(self, invitation_id):
"""
Get invitation by an invitation id.
:type invitation_id: str
:param invitation_id: The unique ID of this invitation
"""

if self.invitation_exists(invitation_id):
return self.session.query(Invitation)\
.filter_by(id=invitation_id).one()
else:
return False

def get_invitations(self, person_id):
"""
Get invitations created by a particular person.
Expand Down

0 comments on commit 585b39e

Please sign in to comment.