Add a namespace selector for choosing the namespace in the new repo view

This commit is contained in:
Joseph Schorr 2013-11-01 17:35:26 -04:00
parent d7148b1711
commit 1f0b142535
6 changed files with 75 additions and 6 deletions

View file

@ -221,13 +221,15 @@ def get_organization(orgname):
def create_repo_api():
owner = current_user.db_user()
namespace_name = owner.username
repository_name = request.get_json()['repository']
visibility = request.get_json()['visibility']
# TODO(jake): Verify that the user can create a repo in this namespace.
json = request.get_json()
namespace_name = json['namespace'] if 'namespace' in json else owner.username
repository_name = json['repository']
visibility = json['visibility']
repo = model.create_repository(namespace_name, repository_name, owner,
visibility)
repo.description = request.get_json()['description']
repo.description = json['description']
repo.save()
return jsonify({