Merge pull request #3736 from ryanpetrello/red-means-loud-on-the-internet

make deprecation warnings at /api/ much more obvious

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-04-18 17:05:33 +00:00 committed by GitHub
commit 97a6255531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -73,6 +73,11 @@
<!-- Content -->
<div id="content" role="main" aria-label="{% trans "content" %}">
{% if deprecated %}
<div class="breadcrumb" style="background: #FCC;">
<b>This resource has been deprecated and will be removed in a future release.</b>
</div>
{% endif %}
{% block content %}
<div class="region" aria-label="{% trans "request form" %}">

View File

@ -13,8 +13,14 @@ def settings(request):
}
def version(request):
context = getattr(request, 'parser_context', {})
return {
'version': get_awx_version(),
'tower_version': get_awx_version(),
'short_tower_version': get_awx_version().split('-')[0],
'deprecated': getattr(
context.get('view'),
'deprecated',
False
) or request.path.startswith('/api/v1/')
}