Django

Code

Changeset 7724

Show
Ignore:
Timestamp:
06/22/08 01:50:25 (5 months ago)
Author:
russellm
Message:

Fixed #7517 -- Added code to remove Sites from the site cache when they are deleted. Thanks to Marc Fargas for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/sites/models.py

    r6296 r7724  
    4545        return self.domain 
    4646 
     47    def delete(self): 
     48        pk = self.pk 
     49        super(Site, self).delete() 
     50        try: 
     51            del(SITE_CACHE[pk]) 
     52        except KeyError: 
     53            pass 
     54         
     55 
    4756class RequestSite(object): 
    4857    """