Commit 2685a080 authored by Johannes Löthberg's avatar Johannes Löthberg
Browse files

devel/views: Invalidate template fragment cache on profile update

Closes #166.

Signed-off-by: Johannes Löthberg's avatarJohannes Löthberg <>
parent 184bf569
......@@ -9,6 +9,8 @@
from django.contrib.auth.models import Group, User
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
from django.core.cache.utils import make_template_fragment_key
from django.db import transaction
from django.db.models import Count, Max
from django.http import Http404, HttpResponseRedirect
......@@ -171,6 +173,12 @@ def change_profile(request):
with transaction.atomic():
# Invalidate userlist.html template cache fragment.
for group in request.user.groups.all():
key = make_template_fragment_key('dev-tu-profiles', [])
return HttpResponseRedirect('/devel/')
form = ProfileForm(initial={'email':})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment