- Fix namespace drop down to save the namespace last selected (and validate)

- Add a "can_create_repo" entry to the organization and have orgs grayed out in the new repo view if the user cannot create a repo
- Fix the multiple-orgs bug in the model
- Have the "create new repository" button disappear on landing if the org is selected and the user does not have create permissions for that org
This commit is contained in:
Joseph Schorr 2013-11-07 00:49:13 -05:00
parent 4b460be4dd
commit 0c4dec6de4
10 changed files with 89 additions and 14 deletions

View file

@ -322,7 +322,7 @@ def verify_user(username, password):
def get_user_organizations(username):
UserAlias = User.alias()
all_teams = User.select().join(Team).join(TeamMember)
all_teams = User.select().distinct().join(Team).join(TeamMember)
with_user = all_teams.join(UserAlias, on=(UserAlias.id == TeamMember.user))
return with_user.where(User.organization == True,
UserAlias.username == username)