Ejemplo n.º 1
0
def extra(request):
    """
    Context processor to inject (and cache queryset) the bank accounts of the
    current user.
    """
    data = {}

    if request.user.is_authenticated:
        data['user_bankaccounts'] = BankAccount.objects.get_user_bankaccounts(
            request.user)

    if settings.MYMONEY['USE_L10N_DIST']:
        data['dist_js_src'] = "dist/js/mymoney.min.{lang}.js".format(
            lang=get_language_upper())
    else:
        data['dist_js_src'] = 'dist/js/mymoney.min.js'

    return data
Ejemplo n.º 2
0
def extra(request):
    """
    Context processor to inject (and cache queryset) the bank accounts of the
    current user.
    """
    data = {}

    if request.user.is_authenticated:
        data['user_bankaccounts'] = BankAccount.objects.get_user_bankaccounts(
            request.user
        )

    if settings.MYMONEY['USE_L10N_DIST']:
        data['dist_js_src'] = "dist/js/mymoney.min.{lang}.js".format(lang=get_language_upper())
    else:
        data['dist_js_src'] = 'dist/js/mymoney.min.js'

    return data
Ejemplo n.º 3
0
def language_to_upper(lang):
    """
    Force language given to be uppercase.
    """
    return get_language_upper(lang)
Ejemplo n.º 4
0
def language_to_upper(lang):
    """
    Force language given to be uppercase.
    """
    return get_language_upper(lang)