From eec998faa321e4981cc17821b9221905a8f0cfff Mon Sep 17 00:00:00 2001 From: Enrico Zini Date: Sat, 25 Apr 2020 13:07:18 +0200 Subject: [PATCH] Removed compatibility names, just use request.impersonator. refs: #12 --- backend/mixins.py | 6 +----- nmlayout/templates/nm2-base.html | 8 ++++---- signon/templates/signon/login.html | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/backend/mixins.py b/backend/mixins.py index 5007f03..95a48a3 100644 --- a/backend/mixins.py +++ b/backend/mixins.py @@ -22,16 +22,13 @@ class OverrideView(Exception): class VisitorMixin(NM2LayoutMixin): """ - Add self.visitor and self.impersonator to the View for the person visiting - the site + Add self.visitor to the View for the person visiting the site """ # Define to "dd" "am" or "admin" to raise PermissionDenied if the # given test on the visitor fails require_visitor = None def set_visitor_info(self): - self.impersonator = getattr(self.request, "impersonator", None) - if not self.request.user.is_authenticated: self.visitor = None else: @@ -70,7 +67,6 @@ class VisitorMixin(NM2LayoutMixin): def get_context_data(self, **kw): ctx = super(VisitorMixin, self).get_context_data(**kw) ctx["visitor"] = self.visitor - ctx["impersonator"] = self.impersonator return ctx diff --git a/nmlayout/templates/nm2-base.html b/nmlayout/templates/nm2-base.html index 18358e0..a6f10d2 100644 --- a/nmlayout/templates/nm2-base.html +++ b/nmlayout/templates/nm2-base.html @@ -78,10 +78,10 @@ window.nm2.url_api_people = "{% url 'api_people' %}";