From 1e1bec0afe35cbb430a7f0840c25d8bec9f57b00 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 4 Jan 2018 13:42:05 -0500 Subject: [PATCH] Remove extra update call on create repo --- data/model/repository.py | 5 +++-- endpoints/api/repository_models_pre_oci.py | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/model/repository.py b/data/model/repository.py index 2d7970e82..0ffefdffb 100644 --- a/data/model/repository.py +++ b/data/model/repository.py @@ -33,11 +33,12 @@ def get_public_repo_visibility(): return _basequery.get_public_repo_visibility() -def create_repository(namespace, name, creating_user, visibility='private', repo_kind='image'): +def create_repository(namespace, name, creating_user, visibility='private', repo_kind='image', + description=None): private = Visibility.get(name=visibility) namespace_user = User.get(username=namespace) repo = Repository.create(name=name, visibility=private, namespace_user=namespace_user, - kind=Repository.kind.get_id(repo_kind)) + kind=Repository.kind.get_id(repo_kind), description=description) admin = Role.get(name='admin') yesterday = datetime.now() - timedelta(days=1) diff --git a/endpoints/api/repository_models_pre_oci.py b/endpoints/api/repository_models_pre_oci.py index 693767c0e..4dd7e5524 100644 --- a/endpoints/api/repository_models_pre_oci.py +++ b/endpoints/api/repository_models_pre_oci.py @@ -126,8 +126,7 @@ class PreOCIModel(RepositoryDataInterface): def create_repo(self, namespace_name, repository_name, owner, description, visibility='private', repo_kind='image'): repo = model.repository.create_repository(namespace_name, repository_name, owner, visibility, - repo_kind=repo_kind) - model.repository.set_description(repo, description) + repo_kind=repo_kind, description=description) return Repository(namespace_name, repository_name) def get_repo(self, namespace_name, repository_name, user):