2018-07-12 16:00:35 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
2019-06-21 09:09:18 +00:00
|
|
|
from .utils import current_org, get_org_from_request
|
2018-07-12 16:00:35 +00:00
|
|
|
from .models import Organization
|
|
|
|
|
|
|
|
|
|
|
|
def org_processor(request):
|
|
|
|
context = {
|
|
|
|
'ADMIN_ORGS': Organization.get_user_admin_orgs(request.user),
|
2019-06-21 09:09:18 +00:00
|
|
|
'CURRENT_ORG': get_org_from_request(request),
|
2018-07-20 09:49:47 +00:00
|
|
|
'HAS_ORG_PERM': current_org.can_admin_by(request.user),
|
2018-07-12 16:00:35 +00:00
|
|
|
}
|
|
|
|
return context
|
|
|
|
|