Add a description field to teams.

This commit is contained in:
yackob03 2013-11-04 16:57:20 -05:00
parent 7991c3eff8
commit ac71822352
4 changed files with 7 additions and 4 deletions

View file

@ -89,7 +89,7 @@ def create_organization(name, email, creating_user):
new_org.save()
# Create a team for the owners
owners_team = create_team('Owners', new_org, 'admin')
owners_team = create_team('owners', new_org, 'admin')
# Add the user who created the org to the owners team
add_user_to_team(creating_user, owners_team)
@ -99,7 +99,7 @@ def create_organization(name, email, creating_user):
raise InvalidOrganizationException('Invalid organization name: %s' % name)
def create_team(name, org, team_role_name):
def create_team(name, org, team_role_name, description=''):
if not validate_username(name):
raise InvalidTeamException('Invalid team name: %s' % name)
@ -108,7 +108,8 @@ def create_team(name, org, team_role_name):
org.username)
team_role = TeamRole.get(TeamRole.name == team_role_name)
return Team.create(name=name, organization=org, role=team_role)
return Team.create(name=name, organization=org, role=team_role,
description=description)
def add_user_to_team(user, team):