middleware give projects lists for all views
This commit is contained in:
parent
b686c5fd57
commit
b0505a4c51
1 changed files with 2 additions and 3 deletions
|
@ -20,9 +20,6 @@ class ProjectMiddleware:
|
||||||
|
|
||||||
def process_view(self, request, view, view_args, view_kwargs):
|
def process_view(self, request, view, view_args, view_kwargs):
|
||||||
|
|
||||||
if view.__module__ not in modules:
|
|
||||||
return
|
|
||||||
|
|
||||||
if not hasattr(request, 'user'):
|
if not hasattr(request, 'user'):
|
||||||
raise ImproperlyConfigured(
|
raise ImproperlyConfigured(
|
||||||
"The project middleware requires the"
|
"The project middleware requires the"
|
||||||
|
@ -73,6 +70,8 @@ class ProjectMiddleware:
|
||||||
request.projects = projects
|
request.projects = projects
|
||||||
|
|
||||||
# project
|
# project
|
||||||
|
if view.__module__ not in modules:
|
||||||
|
return
|
||||||
project = view_kwargs.get('project')
|
project = view_kwargs.get('project')
|
||||||
if not project:
|
if not project:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue