(app_configs=None, **kwargs)
return messages
Check the user has configured API version correctly.
Check the user has configured API version correctly.
Check the user has configured API version correctly .
def check_stripe_api_version(app_configs=None, **kwargs):
    """Check the user has configured API version correctly."""
    from .settings import djstripe_settings

    messages = []
    default_version = djstripe_settings.DEFAULT_STRIPE_API_VERSION
    version = djstripe_settings.STRIPE_API_VERSION

    if not validate_stripe_api_version(version):
        msg = "Invalid Stripe API version: {}".format(version)
        hint = "STRIPE_API_VERSION should be formatted as: YYYY-MM-DD"
        messages.append(checks.Critical(msg, hint=hint, id="djstripe.C004"))

    if version != default_version:
        msg = (
            "The Stripe API version has a non-default value of '{}'. "
            "Non-default versions are not explicitly supported, and may "
            "cause compatibility issues.".format(version)
        )
        hint = "Use the dj-stripe default for Stripe API version: {}".format(
            default_version
        )
        messages.append(checks.Warning(msg, hint=hint, id="djstripe.W001"))

    return messages
def check_stripe_api_version ( app_configs = None , * * kwargs ) : from . settings import djstripe_settings messages = [ ] default_version = djstripe_settings . DEFAULT_STRIPE_API_VERSION version = djstripe_settings . STRIPE_API_VERSION if not validate_stripe_api_version ( version ) : msg = "Invalid Stripe API version: {}" . format ( version ) hint = "STRIPE_API_VERSION should be formatted as: YYYY-MM-DD" messages . append ( checks . Critical ( msg , hint = hint , id = "djstripe.C004" ) ) if version != default_version : msg = ( "The Stripe API version has a non-default value of '{}'. " "Non-default versions are not explicitly supported, and may " "cause compatibility issues." . format ( version ) ) hint = "Use the dj-stripe default for Stripe API version: {}" . format ( default_version ) messages . append ( checks . Warning ( msg , hint = hint , id = "djstripe.W001" ) ) return messages