From ccc292d9a98252bdec112e2efdaf87c9efaae4a5 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 7 Aug 2018 18:38:46 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E5=8E=BB=E6=8E=89debug=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/permissions.py | 3 --- apps/orgs/mixins.py | 1 - 2 files changed, 4 deletions(-) diff --git a/apps/common/permissions.py b/apps/common/permissions.py index 9d01031bc..4693748eb 100644 --- a/apps/common/permissions.py +++ b/apps/common/permissions.py @@ -79,7 +79,6 @@ class AdminUserRequiredMixin(UserPassesTestMixin): return True def dispatch(self, request, *args, **kwargs): - print("Current org: {}".format(current_org)) if not request.user.is_authenticated: return super().dispatch(request, *args, **kwargs) @@ -92,6 +91,4 @@ class AdminUserRequiredMixin(UserPassesTestMixin): print("Is org admin") return redirect('orgs:switch-a-org') return HttpResponseForbidden() - else: - print(current_org.can_admin_by(request.user)) return super().dispatch(request, *args, **kwargs) diff --git a/apps/orgs/mixins.py b/apps/orgs/mixins.py index 7557600cb..99140f40b 100644 --- a/apps/orgs/mixins.py +++ b/apps/orgs/mixins.py @@ -43,7 +43,6 @@ class OrgManager(models.Manager): def all(self): if not current_org: msg = 'You can `objects.set_current_org(org).all()` then run it' - warnings.warn(msg) return self else: return super(OrgManager, self).all()