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



3 years ago
2 years ago


(Reporter: mythmon, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: u=user p=1)



3 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.


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)


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