#316 closed defect (fixed)
Error while logging into Admin site since revision 487
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | major | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have been using Django for more than a week now. I love it! And I am using the Admin site in the same way every day, by using:
django-admin.py runserver --settings=MyDjango.settings.admin
Yet, yesterday I got this error:
There's been an error:
Traceback (most recent call last):
File "/usr/lib64/python2.3/site-packages/django/core/handlers/base.py", line 59, in get_response
response = middleware_method(request, callback, param_dict)
File "/usr/lib64/python2.3/site-packages/django/middleware/admin.py", line 77, in process_view
sessions.start_web_session(user.id, request, response)
File "/usr/lib64/python2.3/site-packages/django/models/auth.py", line 227, in _module_start_web_session
user.save()
File "/usr/lib64/python2.3/site-packages/django/utils/functional.py", line 3, in _curried
return args[0](*(args[1:]+moreargs), dict(kwargs.items() + morekwargs.items()))
File "/usr/lib64/python2.3/site-packages/django/core/meta/init.py", line 735, in method_save
db_values + [getattr(self, opts.pk.name)])
File "/usr/lib64/python2.3/site-packages/django/core/db/base.py", line 10, in execute
result = self.cursor.execute(sql, params)
File "/usr/lib64/python2.3/site-packages/MySQLdb/cursors.py", line 95, in execute
return self._execute(query, args)
File "/usr/lib64/python2.3/site-packages/MySQLdb/cursors.py", line 114, in _execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.3/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler
raise errorclass, errorvalue
Warning: Rows matched: 1 Changed: 1 Warnings: 1
Do you have any clue how I can solve this issue?
Thanks.
Change History (8)
comment:1 by , 19 years ago
Summary: | Error while logging into Admin site → Error while logging into Admin site since revision 487 |
---|
comment:2 by , 19 years ago
Status: | new → assigned |
---|
It's a stupid MySQL problem...I'm looking into it now. Thanks for the heads up!
comment:3 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 19 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Reopened. The fix from [494] caused other problems.
comment:5 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:6 by , 19 years ago
Resolution: | fixed |
---|---|
Severity: | critical → major |
Status: | closed → reopened |
Adrian,
Sorry, I got an error on your modification.
There's been an error:
Traceback (most recent call last):
File "/usr/lib64/python2.3/site-packages/django/core/handlers/base.py", line 62, in get_response
return callback(request, param_dict)
File "/usr/lib64/python2.3/site-packages/MyDjango/apps/articleStore/views/articleStore.py", line 80, in update
fileModified=os.stat(os.path.join(store.articleFolder, fname)).st_mtime
File "/usr/lib64/python2.3/site-packages/django/utils/functional.py", line 3, in _curried
return args[0](*(args[1:]+moreargs), dict(kwargs.items() + morekwargs.items()))
File "/usr/lib64/python2.3/site-packages/django/core/meta/init.py", line 897, in method_add_related
obj.save()
File "/usr/lib64/python2.3/site-packages/django/utils/functional.py", line 3, in _curried
return args[0](*(args[1:]+moreargs), dict(kwargs.items() + morekwargs.items()))
File "/usr/lib64/python2.3/site-packages/django/core/meta/init.py", line 748, in method_save
db_values = [f.get_db_prep_save(f.pre_save(getattr(self, f.name), True)) for f in opts.fields if not isinstance(f, AutoField)]
File "/usr/lib64/python2.3/site-packages/django/core/meta/fields.py", line 305, in get_db_prep_save
value = value.replace(microsecond=0)
TypeError: 'microsecond' is an invalid keyword argument for this function
The reason why this error appears is that I am not passing a datetime object, but a date object. Before your change this worked perfectly. But, a date object has no parameter microsecond. A datetime object does. Is the code only meant to support the datetime object? Or should it also support date and time objects? If so, then the code needs some modification.
Thanks,
Berry
comment:7 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I believe this is fixed now. If it's still a problem, please reopen with full details.
I try to keep up with the latest revisions. So, I tested former revisions to see if the Admin site works in former revisions. And it does!
Up till revision 484 the Admin site works perfectly. But, the problem starts at revision 487! Then I get the errors as reported earlier. I am using a MySQL (version 3.23.58) backend. Apparently something was introduced in revision 487 that causes the Admin site to break!