If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[traceback] TypeError: astimezone() argument 1 must be datetime.tzinfo, not None

NEW
Unassigned

Status

support.mozilla.org
Code Quality
2 years ago
2 months ago

People

(Reporter: mythmon, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: u=user p=1)

(Reporter)

Description

2 years ago
Looks like some requests don't have a timezone associated with them. Probably nothing we really need to worry about, but it would be good to not throw an error.

https://sentry.prod.mozaws.net/operations/sumo/group/205786/

TypeError: astimezone() argument 1 must be datetime.tzinfo, not None

Stacktrace (most recent call last):

  File "django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "newrelic/hooks/framework_django.py", line 497, in wrapper
    return wrapped(*args, **kwargs)
  File "django/views/decorators/http.py", line 41, in inner
    return func(request, *args, **kwargs)
  File "kitsune/dashboards/views.py", line 111, in localization
    extra_data=data, product=product)
  File "kitsune/dashboards/utils.py", line 78, in render_readouts
    return render(request, 'dashboards/' + template, data)
  File "django/shortcuts.py", line 50, in render
    return HttpResponse(loader.render_to_string(*args, **kwargs),
  File "django/template/loader.py", line 178, in render_to_string
    return t.render(context_instance)
  File "jingo/__init__.py", line 98, in render
    return super(Template, self).render(context_dict)
  File "newrelic/api/function_trace.py", line 98, in dynamic_wrapper
    return wrapped(*args, **kwargs)
  File "jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)
  File "/data/www/support.mozilla.org/kitsune/kitsune/dashboards/templates/dashboards/localization.html", line 8, in top-level template code
    {% set classes = 'localization-dashboard' %}
  File "/data/www/support.mozilla.org/kitsune/kitsune/sumo/templates/base.html", line 187, in top-level template code
    {% block content %}{% endblock %}
  File "/data/www/support.mozilla.org/kitsune/kitsune/dashboards/templates/dashboards/localization.html", line 22, in block "content"
    {{ datetimeformat(a.show_after, 'date') }}
  File "kitsune/sumo/helpers.py", line 239, in datetimeformat
    convert_value = new_value.astimezone(convert_tzinfo)

Updated

2 months ago
Component: General → Code Quality
You need to log in before you can comment on or make changes to this bug.