#8159: Attempting to delete your own user account in Django admin view is not
handled properly
-------------------------------------------+--------------------------------
Reporter: [email protected] | Owner: graham_king
Status: assigned | Milestone: post-1.0
Component: django.contrib.admin | Version: SVN
Resolution: | Keywords: admin delete
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by graham_king):
* needs_better_patch: 1 => 0
Comment:
Yes, that was the problem. I have added a test for that case.
I've updated the patch to take a different route. It catches the
IntegrityError. If the logged in user is gone, it ignores the exception,
if not it raises it.
The crux of the problem is that the same user is in memory twice - once as
the logged in user and once as the deleted user. The id of the deleted
user gets correctly null-ed, but not the id of the logged in user. The
single instance proposal would fix this:
http://code.djangoproject.com/wiki/DjangoSpecifications/Core/SingleInstance
In the meantime this patch adds a helpful warning and prevents things
blowing up.
--
Ticket URL: <http://code.djangoproject.com/ticket/8159#comment:10>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---