#7517 closed (fixed)
Site.objects.get_current() returns deleted objects
Description ¶
#7514 lead to find this bug.
>>> from django.contrib.sites.models import Site >>> s = Site.objects.get_current() >>> s <Site: example.com> >>> s.delete() >>> Site.objects.get_current() <Site: example.com>
Obviously, the last one should be a DoesNotExist. Patch incoming.
Change History (4)
by , 17 years ago
Attachment: | site_delete.diff added |
---|
comment:1 by , 17 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Ready for checkin |
Attached patch overrides Site.delete() to delete the Site from the SITE_CACHE.
Includes a test.
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Remove Site from CACHE on delete.