11 lines
272 B
Python
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()
|