[Update] 修改get_current_org 为 proxy对象 current_org

This commit is contained in:
ibuler
2018-07-20 17:49:47 +08:00
parent b5f6f80ae6
commit e3aa18ff2d
18 changed files with 171 additions and 34 deletions

View File

@@ -1,14 +1,16 @@
# -*- coding: utf-8 -*-
#
from .utils import get_current_org
from .utils import current_org, get_current_org
from .models import Organization
def org_processor(request):
print('Crernt Org', current_org.name)
context = {
'ADMIN_ORGS': Organization.get_user_admin_orgs(request.user),
'CURRENT_ORG': get_current_org(),
'HAS_ORG_PERM': current_org.can_admin_by(request.user),
}
return context