Merge pull request #6565 from chrismeyersfsu/fix-schema_workflow_identifier

static identifier in OPTIONS response for workflow job template node

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-04-03 21:20:37 +00:00 committed by GitHub
commit 2aa29420ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
# All Rights Reserved.
from collections import OrderedDict
from uuid import UUID
# Django
from django.core.exceptions import PermissionDenied
@ -86,6 +87,8 @@ class Metadata(metadata.SimpleMetadata):
# FIXME: Still isn't showing all default values?
try:
default = field.get_default()
if type(default) is UUID:
default = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
if field.field_name == 'TOWER_URL_BASE' and default == 'https://towerhost':
default = '{}://{}'.format(self.request.scheme, self.request.get_host())
field_info['default'] = default