diff gpp/bio/models.py @ 54:e249b5f9d180

#3, #4: clear caches when saving profile, bulletins, and news. Broke up the stuff on the home page for finer control of caching.
author Brian Neal <bgneal@gmail.com>
date Tue, 23 Jun 2009 00:11:00 +0000
parents 5eed5e7c1c98
children c0d3b09c9b95
line wrap: on
line diff
--- a/gpp/bio/models.py	Sun Jun 21 22:41:58 2009 +0000
+++ b/gpp/bio/models.py	Tue Jun 23 00:11:00 2009 +0000
@@ -9,6 +9,7 @@
 from django.contrib import auth
 from django.conf import settings
 from django.template.loader import render_to_string
+from django.core.cache import cache
 
 
 def avatar_file_path_for_user(username, filename):
@@ -46,4 +47,5 @@
         html = render_to_string('bio/markdown.html', {'data': self.signature})
         self.signature_html = html.strip()
         super(UserProfile, self).save(*args, **kwargs)
+        cache.delete('avatar_' + self.user.username)