File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 9
9
user_passes_test )
10
10
from django .contrib .auth .models import Group , User
11
11
from django .contrib .contenttypes .models import ContentType
12
+ from django .core .cache import cache
13
+ from django .core .cache .utils import make_template_fragment_key
12
14
from django .db import transaction
13
15
from django .db .models import Count , Max
14
16
from django .http import Http404 , HttpResponseRedirect
@@ -171,6 +173,12 @@ def change_profile(request):
171
173
with transaction .atomic ():
172
174
request .user .save ()
173
175
profile_form .save ()
176
+
177
+ # Invalidate userlist.html template cache fragment.
178
+ for group in request .user .groups .all ():
179
+ key = make_template_fragment_key ('dev-tu-profiles' , [group .name ])
180
+ cache .delete (key )
181
+
174
182
return HttpResponseRedirect ('/devel/' )
175
183
else :
176
184
form = ProfileForm (initial = {'email' : request .user .email })
You can’t perform that action at this time.
0 commit comments