#19929: "USE_TZ = True" causes error
-------------------------------+-------------------------------
     Reporter:  tomas_00       |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  master
     Severity:  Normal         |   Keywords:  datetime,timzone,
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+-------------------------------
 When setting USE_TZ to True, this error appears:

 'NoneType' object has no attribute 'replace'

 {{{
 Environment:


 Request Method: GET
 Request URL: http://domain.com/admin/news/image/

 Django Version: 1.6.dev20130227090207
 Python Version: 2.7.3
 Installed Applications:
 ('django.contrib.admin',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  'django.contrib.sites',
  'django.contrib.flatpages',
  'south',
  'djcelery',
  'gunicorn',
  'sorl.thumbnail',
  'template_utils',
  'compressor',
  'tagging',
  'ckeditor',
  'debug_toolbar',
  'mptt',
  'news',)
 Installed Middleware:
 ('django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.locale.LocaleMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'myapp.CookieMiddleware.CookieMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware')


 Template error:
 In template /home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/contrib/admin/templates/admin/change_list.html, error at line
 73
    'NoneType' object has no attribute 'replace'
    63 :       {% endif %}


    64 :     {% endblock %}


    65 :     {% if cl.formset.errors %}


    66 :         <p class="errornote">


    67 :         {% blocktrans count cl.formset.errors|length as counter
 %}Please correct the error below.{% plural %}Please correct the errors
 below.{% endblocktrans %}


    68 :         </p>


    69 :         {{ cl.formset.non_form_errors }}


    70 :     {% endif %}


    71 :     <div class="module{% if cl.has_filters %} filtered{% endif %}"
 id="changelist">


    72 :       {% block search %}{% search_form cl %}{% endblock %}


    73 :       {% block date_hierarchy %} {% date_hierarchy cl %} {%
 endblock %}


    74 :


    75 :       {% block filters %}


    76 :         {% if cl.has_filters %}


    77 :           <div id="changelist-filter">


    78 :             <h2>{% trans 'Filter' %}</h2>


    79 :             {% for spec in cl.filter_specs %}{% admin_list_filter
 cl spec %}{% endfor %}


    80 :           </div>


    81 :         {% endif %}


    82 :       {% endblock %}


    83 :


 Traceback:
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/core/handlers/base.py" in get_response
   130.                     response = response.render()
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/response.py" in render
   105.             self.content = self.rendered_content
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/response.py" in rendered_content
   82.         content = template.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   140.             return self._render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in _render
   134.         return self.nodelist.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   837.                 bit = self.render_node(node, context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/debug.py" in render_node
   78.             return node.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/loader_tags.py" in render
   123.         return compiled_parent._render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in _render
   134.         return self.nodelist.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   837.                 bit = self.render_node(node, context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/debug.py" in render_node
   78.             return node.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/loader_tags.py" in render
   123.         return compiled_parent._render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in _render
   134.         return self.nodelist.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   837.                 bit = self.render_node(node, context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/debug.py" in render_node
   78.             return node.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/loader_tags.py" in render
   62.             result = block.nodelist.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   837.                 bit = self.render_node(node, context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/debug.py" in render_node
   78.             return node.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/loader_tags.py" in render
   62.             result = block.nodelist.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   837.                 bit = self.render_node(node, context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/debug.py" in render_node
   78.             return node.render(context)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/template/base.py" in render
   1192.                     _dict = func(*resolved_args,
 **resolved_kwargs)
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/contrib/admin/templatetags/admin_list.py" in date_hierarchy
   362.                 } for year in years]
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/db/models/query.py" in _result_iter
   125.                 self._fill_cache()
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/db/models/query.py" in _fill_cache
   962.                     self._result_cache.append(next(self._iter))
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/db/models/query.py" in _safe_iterator
   348.             for item in iterator:
 File "/home/USER/.virtualenvs/SITE/downloads/django-
 trunk/django/db/models/sql/compiler.py" in results_iter
   1065.                     datetime = datetime.replace(tzinfo=None)

 Exception Type: AttributeError at /admin/news/image/
 Exception Value: 'NoneType' object has no attribute 'replace'

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19929>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to