Fall back to a job number if entity specifier is just numbers

This commit is contained in:
Reuben Morais 2019-04-11 15:36:36 -03:00
Родитель 03091c6420
Коммит 73b5756876
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -529,8 +529,8 @@ function printJobGroups(groups, asDate) {
}
}
function getEntityPath (entity) {
entity = parseEntity(entity)
function getEntityPath (entitySpec) {
entity = parseEntity(entitySpec)
if (entity.type == 'home') {
return 'users/~'
}
@ -540,6 +540,9 @@ function getEntityPath (entity) {
if (entity.type == 'shared') {
return 'shared'
}
if (entitySpec.match(/^[0-9]+$/)) {
return getEntityPath('job:' + entitySpec);
}
fail('Unsupported entity type "' + entity.type + '"')
}