From a660c433bbc0188831b319bbba72ffba677e75b3 Mon Sep 17 00:00:00 2001 From: Ryan Cross Date: Tue, 17 Feb 2015 19:55:54 +0000 Subject: [PATCH] Fixes #1605. Editing session request causes KeyError. Commit ready for merge. - Legacy-Id: 9097 --- ietf/meeting/helpers.py | 9 +++++---- ietf/secr/sreq/views.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ietf/meeting/helpers.py b/ietf/meeting/helpers.py index 4046442d4..0f6581176 100644 --- a/ietf/meeting/helpers.py +++ b/ietf/meeting/helpers.py @@ -168,13 +168,14 @@ def agenda_permissions(meeting, schedule, user): return cansee, canedit, secretariat -def session_constraint_expire(session): +def session_constraint_expire(request,session): from django.core.urlresolvers import reverse from ajax import session_constraints path = reverse(session_constraints, args=[session.meeting.number, session.pk]) - request = HttpRequest() - request.path = path - key = get_cache_key(request) + temp_request = HttpRequest() + temp_request.path = path + temp_request.META['HTTP_HOST'] = request.META['HTTP_HOST'] + key = get_cache_key(temp_request) if key is not None and cache.has_key(key): cache.delete(key) diff --git a/ietf/secr/sreq/views.py b/ietf/secr/sreq/views.py index 3ddbb03cf..fb5fd1631 100644 --- a/ietf/secr/sreq/views.py +++ b/ietf/secr/sreq/views.py @@ -448,7 +448,7 @@ def edit_mtg(request, num, acronym): # nuke any cache that might be lingering around. from ietf.meeting.helpers import session_constraint_expire - session_constraint_expire(session) + session_constraint_expire(request,session) messages.success(request, 'Session Request updated') return redirect('sessions_view', acronym=acronym)