Ejemplo n.º 1
0
def appearance_settings(request):
    options = UserOption.objects.get_all_values(user=request.user,
                                                project=None)

    form = AppearanceSettingsForm(request.user,
                                  request.POST or None,
                                  initial={
                                      'language':
                                      options.get('language')
                                      or request.LANGUAGE_CODE,
                                      'stacktrace_order':
                                      options.get('stacktrace_order'),
                                  })
    if form.is_valid():
        form.save()
        messages.add_message(request, messages.SUCCESS,
                             'Your settings were saved.')
        return HttpResponseRedirect(request.path)

    context = csrf(request)
    context.update({
        'form': form,
        'page': 'appearance',
    })
    return render_to_response('sentry/account/appearance.html', context,
                              request)
Ejemplo n.º 2
0
def appearance_settings(request):
    from django.conf import settings

    options = UserOption.objects.get_all_values(user=request.user,
                                                project=None)

    form = AppearanceSettingsForm(
        request.user,
        request.POST or None,
        initial={
            'language': options.get('language') or request.LANGUAGE_CODE,
            'stacktrace_order': int(options.get('stacktrace_order', -1) or -1),
            'timezone': options.get('timezone')
            or settings.SENTRY_DEFAULT_TIME_ZONE,
            'clock_24_hours': options.get('clock_24_hours') or False,
        })
    if form.is_valid():
        form.save()
        messages.add_message(request, messages.SUCCESS,
                             'Your settings were saved.')
        return HttpResponseRedirect(request.path)

    context = csrf(request)
    context.update({
        'form': form,
        'page': 'appearance',
        'AUTH_PROVIDERS': auth.get_auth_providers(),
        'has_newsletters': newsletter.is_enabled,
    })
    return render_to_response('sentry/account/appearance.html', context,
                              request)
Ejemplo n.º 3
0
def appearance_settings(request):
    from django.conf import settings

    options = UserOption.objects.get_all_values(user=request.user, project=None)

    form = AppearanceSettingsForm(
        request.user,
        request.POST or None,
        initial={
            'language': options.get('language') or request.LANGUAGE_CODE,
            'stacktrace_order': int(options.get('stacktrace_order', -1) or -1),
            'timezone': options.get('timezone') or settings.SENTRY_DEFAULT_TIME_ZONE,
            'clock_24_hours': options.get('clock_24_hours') or False,
        }
    )
    if form.is_valid():
        form.save()
        messages.add_message(request, messages.SUCCESS, 'Your settings were saved.')
        return HttpResponseRedirect(request.path)

    context = csrf(request)
    context.update(
        {
            'form': form,
            'page': 'appearance',
            'AUTH_PROVIDERS': auth.get_auth_providers(),
            'has_newsletters': newsletter.is_enabled,
        }
    )
    return render_to_response('sentry/account/appearance.html', context, request)
Ejemplo n.º 4
0
def appearance_settings(request):
    options = UserOption.objects.get_all_values(user=request.user, project=None)

    form = AppearanceSettingsForm(request.user, request.POST or None, initial={
        'language': options.get('language') or request.LANGUAGE_CODE,
        'stacktrace_order': int(options.get('stacktrace_order', -1) or -1),
    })
    if form.is_valid():
        form.save()
        messages.add_message(request, messages.SUCCESS, 'Your settings were saved.')
        return HttpResponseRedirect(request.path)

    context = csrf(request)
    context.update({
        'form': form,
        'page': 'appearance',
    })
    return render_to_response('sentry/account/appearance.html', context, request)
Ejemplo n.º 5
0
def appearance_settings(request):
    options = UserOption.objects.get_all_values(user=request.user, project=None)

    form = AppearanceSettingsForm(
        request.user,
        request.POST or None,
        initial={
            "language": options.get("language") or request.LANGUAGE_CODE,
            "stacktrace_order": int(options.get("stacktrace_order", -1) or -1),
        },
    )
    if form.is_valid():
        form.save()
        messages.add_message(request, messages.SUCCESS, "Your settings were saved.")
        return HttpResponseRedirect(request.path)

    context = csrf(request)
    context.update({"form": form, "page": "appearance"})
    return render_to_response("sentry/account/appearance.html", context, request)