Add a namespace selector for choosing the namespace in the new repo view
This commit is contained in:
parent
d7148b1711
commit
1f0b142535
6 changed files with 75 additions and 6 deletions
|
@ -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({
|
||||
|
|
Reference in a new issue