Fix the tag image fetch model method.
This commit is contained in:
parent
9278871381
commit
fa1fc7f9a2
1 changed files with 8 additions and 3 deletions
|
@ -144,9 +144,14 @@ def list_repository_tags(namespace_name, repository_name):
|
|||
|
||||
def get_tag_image(namespace_name, repository_name, tag_name):
|
||||
joined = Image.select().join(RepositoryTag).join(Repository)
|
||||
return joined.where(Repository.name == repository_name,
|
||||
Repository.namespace == namespace_name,
|
||||
RepositoryTag.name == tag_name)
|
||||
fetched = list(joined.where(Repository.name == repository_name,
|
||||
Repository.namespace == namespace_name,
|
||||
RepositoryTag.name == tag_name))
|
||||
|
||||
if not fetched:
|
||||
raise Image.DoesNotExist('Unable to find image for tag.')
|
||||
|
||||
return fetched[0]
|
||||
|
||||
|
||||
def create_or_update_tag(namespace_name, repository_name, tag_name,
|
||||
|
|
Reference in a new issue