~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to django/contrib/sites/models.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2009-07-29 11:26:28 UTC
  • mfrom: (1.1.8 upstream) (4.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090729112628-pg09ino8sz0sj21t
Tags: 1.1-1
* New upstream release.
* Merge from experimental:
  - Ship FastCGI initscript and /etc/default file in python-django's examples
    directory (Closes: #538863)
  - Drop "05_10539-sphinx06-compatibility.diff"; it has been applied
    upstream.
  - Bump Standards-Version to 3.8.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
    def __unicode__(self):
43
43
        return self.domain
44
 
    
 
44
 
 
45
    def save(self, *args, **kwargs):
 
46
        super(Site, self).save(*args, **kwargs)
 
47
        # Cached information will likely be incorrect now.
 
48
        if self.id in SITE_CACHE:
 
49
            del SITE_CACHE[self.id]
 
50
 
45
51
    def delete(self):
46
52
        pk = self.pk
47
53
        super(Site, self).delete()
48
54
        try:
49
 
            del(SITE_CACHE[pk])
 
55
            del SITE_CACHE[pk]
50
56
        except KeyError:
51
57
            pass
52
58