Add context processors for security blueprint

This commit is contained in:
Matt Wright
2012-08-17 11:50:23 -04:00
parent adb550a9f2
commit beff7a246d
5 changed files with 99 additions and 8 deletions
+5 -1
View File
@@ -126,6 +126,10 @@ def get_url(endpoint_or_url):
return endpoint_or_url
def get_security_endpoint_name(endpoint):
return '%s.%s' % (_security.blueprint_name, endpoint)
def url_for_security(endpoint, **values):
"""Return a URL for the security blueprint
@@ -137,7 +141,7 @@ def url_for_security(endpoint, **values):
:param _anchor: if provided this is added as anchor to the URL.
:param _method: if provided this explicitly specifies an HTTP method.
"""
endpoint = '%s.%s' % (_security.blueprint_name, endpoint)
endpoint = get_security_endpoint_name(endpoint)
return url_for(endpoint, **values)