#7517 closed (fixed)
Site.objects.get_current() returns deleted objects
| Reported by: | Marc Fargas | Owned by: | Marc Fargas |
|---|---|---|---|
| Component: | Contrib apps | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
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.
Attachments (1)
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.