We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90779ce commit 4e09189Copy full SHA for 4e09189
ansible_base/lib/templatetags/requests.py
@@ -1,19 +1,10 @@
1
+from django import template
2
+
3
from ansible_base.lib.utils import requests as dab_requests
4
-# Global variable to hold the Django template library
-register = None
5
+register = template.Library()
6
7
8
+@register.simple_tag
9
def is_proxied_request():
10
return dab_requests.is_proxied_request()
-
11
-# Auto-register when imported in Django context
12
-try:
13
- from django import template
14
15
- register = template.Library()
16
- register.simple_tag(is_proxied_request)
17
-except ImportError:
18
- # Django not available, defer registration
19
- pass
0 commit comments