#1451 closed defect (fixed)
[magic-removal] AttributeError when editing User in admin
Reported by: | James Bennett | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
Severity: | major | Keywords: | |
Cc: | malcolm@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When editing a user in the admin, as of rev 2475, we get an AttributeError:
{{{ Traceback (most recent call last):
File "/Users/james/dev/magic-removal/magic-removal/django/core/handlers/base.py" in get_response
- response = callback(request, *callback_args, callback_kwargs)
File "/Users/james/dev/magic-removal/magic-removal/django/contrib/admin/views/decorators.py" in _checklogin
- return view_func(request, *args, kwargs)
File "/Users/james/dev/magic-removal/magic-removal/django/contrib/admin/views/main.py" in change_stage
- new_data = manipulator.flatten_data()
File "/Users/james/dev/magic-removal/magic-removal/django/db/models/manipulators.py" in flatten_data
- new_data.update(f.flatten_data(fol, obj))
File "/Users/james/dev/magic-removal/magic-removal/django/db/models/fields/init.py" in flatten_data
- return {date_field: (val is not None and val.strftime("%Y-%m-%d") or ),
AttributeError at /admin/auth/user/1/
'str' object has no attribute 'strftime'} }}}
Change History (6)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
This should be the correct traceback:
Traceback (most recent call last): File "/Users/james/dev/magic-removal/magic-removal/django/core/handlers/base.py" in get_response 73. response = callback(request, *callback_args, **callback_kwargs) File "/Users/james/dev/magic-removal/magic-removal/django/contrib/admin/views/decorators.py" in _checklogin 54. return view_func(request, *args, **kwargs) File "/Users/james/dev/magic-removal/magic-removal/django/contrib/admin/views/main.py" in change_stage 352. new_data = manipulator.flatten_data() File "/Users/james/dev/magic-removal/magic-removal/django/db/models/manipulators.py" in flatten_data 247. new_data.update(f.flatten_data(fol, obj)) File "/Users/james/dev/magic-removal/magic-removal/django/db/models/fields/__init__.py" in flatten_data 413. return {date_field: (val is not None and val.strftime("%Y-%m-%d") or ''), AttributeError at /admin/auth/user/1/ 'str' object has no attribute 'strftime'}
comment:3 by , 19 years ago
For those of you playing along at home, this seems to not be an issue for me on OSX10.4/Python 2.4.1/sqlite 3.1.3/pysqlite 2.0.7. The only difference between our two setups is that James is using Python 2.3.5.
Very weird.
comment:4 by , 19 years ago
Component: | Admin interface → Database wrapper |
---|
We've found a clue: on Matt's setup (Python 2.4.1), nothing goes wrong. On my setup (Python 2.3.5), the typecast functions in django.db.backends.util aren't coming into play; specifically, typecast_timestamp is never getting called on this datetime string.
comment:5 by , 19 years ago
Cc: | added |
---|
So something is not quite right in this report. In revision 2475, the last line of the traceback would have occurred on line 422, not 413. So is you entire codebase up to date here? I am asking because I cannot repeat this problem at all with Python 2.3.4, SQlite 3.2.7 and pysqlite 2.0.4 (on linux-x86).
Does any editing of the User cause this problem, or is there a specific change that needs to be made to trigger it?
comment:6 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Please reopen if this is still a problem.
OK, so atm Trac's wikiformatting isn't doing code, and it interpreted the line numbers as beginning ordered lists. Line numbers, in order, should be: 73, 54, 352, 247, 413.