Files
mayan-edms/mayan/apps/organizations/middleware.py
2016-03-07 01:53:13 -04:00

11 lines
272 B
Python

from .models import Organization
class CurrentOrganizationMiddleware(object):
"""
Middleware that sets `organization` attribute to request object.
"""
def process_request(self, request):
request.organization = Organization.objects.get_current()