#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_tests: 1 => 0
Comment:
Dear reviewer,
* Ignore 8159.diff - if you have the right permissions please delete it.
* 8159-2.diff is the patch of interest. It contains:
- a template to add a warning in the admin interface if you attempt to
delete yourself.
- a fix in contrib/auth/admin.py to prevent the foreign key blowing up
if you do delete yourself
- a test for that foreign key explosion
* To reproduce, make sure your database enforces foreign keys (I used
MySQL InnoDB), then either:
- Apply the patch, revert django/contrib/auth/admin.py, and run the
'admin_views.DeleteSelfTest' test.
- OR create a test user with staff and superuser, login as that test
user, delete that test user (i.e. yourself).
* If this patch is not acceptable, I'd like you to consider
8159-warning.diff. This is the same as 8159-2.diff, except without the fix
and the test, so _just_ the template warning which displays 'You are
attempting to delete yourself'.
* Cheers!
--
Ticket URL: <http://code.djangoproject.com/ticket/8159#comment:8>
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
-~----------~----~----~----~------~----~------~--~---