Fix last modified date time handling for tags with no date times, and fix the sort ordering
This commit is contained in:
parent
fe8d006855
commit
699cb9a5da
3 changed files with 13 additions and 5 deletions
|
@ -177,13 +177,17 @@ class Repository(RepositoryParamResource):
|
|||
logger.debug('Get repo: %s/%s' % (namespace, repository))
|
||||
|
||||
def tag_view(tag):
|
||||
return {
|
||||
tag_info = {
|
||||
'name': tag.name,
|
||||
'image_id': tag.image.docker_image_id,
|
||||
'last_modified': format_date(datetime.datetime.fromtimestamp(tag.lifetime_start_ts)),
|
||||
'size': tag.image.storage.aggregate_size
|
||||
}
|
||||
|
||||
if tag.lifetime_start_ts > 0:
|
||||
tag_info['last_modified'] = format_date(datetime.datetime.fromtimestamp(tag.lifetime_start_ts))
|
||||
|
||||
return tag_info
|
||||
|
||||
organization = None
|
||||
try:
|
||||
organization = model.get_organization(namespace)
|
||||
|
|
Reference in a new issue