Change validators to use the validator_context

Change InstanceKeys to take a namedtuple for context
This commit is contained in:
Sam Chow 2018-05-25 15:42:27 -04:00
parent e967fde3ae
commit 554d4f47a8
31 changed files with 172 additions and 69 deletions

View file

@ -2,6 +2,9 @@ def get_app_url(config):
""" Returns the application's URL, based on the given config. """
return '%s://%s' % (config['PREFERRED_URL_SCHEME'], config['SERVER_HOSTNAME'])
def get_app_url_from_scheme_hostname(url_scheme_and_hostname):
""" Returns the application's URL, based on the given url scheme and hostname. """
return '%s://%s' % (url_scheme_and_hostname.url_scheme, url_scheme_and_hostname.hostname)
def slash_join(*args):
"""