Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21350 closed Bug (duplicate)

Can't Access User page in Admin

Reported by: hodgson_julian@… Owned by: nobody
Component: Forms Version: 1.2
Severity: Normal Keywords: User Admin sqlite
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

On changing to mysqlite and going to the Admin User page, when I click on a User I get the error below.

It works when a test with python manage.py runserver, but not on apache.

Any help much appreciated, let me know if you need more info.

Cheers,

Julian

PS Have used * as security measure below.

Environment:

Request Method: GET
Request URL: ​http://***/admin/auth/user/168/
Django Version: 1.2.7
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',

'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.comments',
,
'django.contrib.admin',
'south']

Installed Middleware:
('django.middleware.common.CommonMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Template error:
In template /usr/local/lib/python2.6/dist-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19

Caught AttributeError while rendering: 'unicode' object has no attribute 'date'
9 : {% for field in line %}

10 : <div{% if not line.fields|length_is:'1' %} class="field-box{% if not field.is_readonly and field.errors %} errors{% endif %}"{% endif %}>

11 : {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}

12 : {% if field.is_checkbox %}

13 : {{ field.field }}{{ field.label_tag }}

14 : {% else %}

15 : {{ field.label_tag }}

16 : {% if field.is_readonly %}

17 : <p>{{ field.contents }}</p>

18 : {% else %}

19 : {{ field.field }}

20 : {% endif %}

21 : {% endif %}

22 : {% if field.field.help_text %}

23 : <p class="help">{{ field.field.help_text|safe }}</p>

24 : {% endif %}

25 : </div>

26 : {% endfor %}

27 : </div>

28 : {% endfor %}

29 : </fieldset>

Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response

response = callback(request, *callback_args, callback_kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in wrapper

return self.admin_site.admin_view(view)(*args, kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view

response = view_func(request, *args, kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func

response = view_func(request, *args, kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner

return view(request, *args, kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapper

return decorator(bound_func)(*args, kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view

response = view_func(request, *args, kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in bound_func

return func(self, *args2, kwargs2)

File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in _commit_on_success

res = func(*args, kw)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in change_view

return self.render_change_form(request, context, change=True, obj=obj)

File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in render_change_form

], context, context_instance=context_instance)

File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/init.py" in render_to_response

return HttpResponse(loader.render_to_string(*args, kwargs), httpresponse_kwargs)

File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in render_to_string

return t.render(context_instance)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

return self._render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in _render

return self.nodelist.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in render

return compiled_parent._render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in _render

return self.nodelist.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in render

return compiled_parent._render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in _render

return self.nodelist.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in render

result = block.nodelist.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in render

nodelist.append(node.render(context))

File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py" in render

return self.template.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

return self._render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in _render

return self.nodelist.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in render

nodelist.append(node.render(context))

File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in render

nodelist.append(node.render(context))

File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in render

return self.nodelist_false.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py" in render

return self.nodelist_false.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/init.py" in render

bits.append(self.render_node(node, context))

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node

result = node.render(context)

File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render

output = force_unicode(output)

File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py" in force_unicode

s = unicode(s)

File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in unicode

return self.as_widget() + self.as_hidden(only_initial=True)

File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in as_widget

return widget.render(name, data, attrs=attrs)

File "/usr/local/lib/python2.6/dist-packages/django/forms/widgets.py" in render

value = self.decompress(value)

File "/usr/local/lib/python2.6/dist-packages/django/forms/widgets.py" in decompress

return [value.date(), value.time().replace(microsecond=0)]

Exception Type: TemplateSyntaxError at /admin/auth/user/168/
Exception Value: Caught AttributeError while rendering: 'unicode' object has no attribute 'date'

Change History (3)

comment:1 by Tim Graham, 11 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #21349

Please use a more recent version of Django -- 1.2 is insecure as it's no longer receiving security updates.

comment:2 by hodgson_julian@…, 11 years ago

Thank you for your response.

Are you aware of this particular problem? My first choice would be to apply a patch if you have seen this issue before.

Otherwise which version do you recommend upgrading to? It's not in the internet so security is not such an issue. Also I'd need to upgrade to a version which doesn't require many changes because of limited resources here.

Looking forward to your reply,

Best,

Julian

comment:3 by Tim Graham, 11 years ago

I don't know. If you can upgrade to the 1.6 release candidate, we could at least see if the issue still exists. We are not fixing bugs like this on older releases. If you could provide a failing test case for Django to reproduce the issue, that would be most helpful.

Note: See TracTickets for help on using tickets.
Back to Top