Commit 364ecdc07536078d7d84b93c3a7321042253410c
1 parent
21c144b7
Exists in
master
and in
39 other branches
Do not use registration middleware if browserid is disabled
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
colab/accounts/middleware.py
| 1 | 1 | ||
| 2 | from django.shortcuts import redirect | 2 | from django.shortcuts import redirect |
| 3 | +from django.conf import settings | ||
| 3 | 4 | ||
| 4 | VIEW_NAMES_ALLOWED = ('signup', 'Logout') | 5 | VIEW_NAMES_ALLOWED = ('signup', 'Logout') |
| 5 | 6 | ||
| @@ -7,6 +8,8 @@ VIEW_NAMES_ALLOWED = ('signup', 'Logout') | @@ -7,6 +8,8 @@ VIEW_NAMES_ALLOWED = ('signup', 'Logout') | ||
| 7 | class UserRegisterMiddleware(object): | 8 | class UserRegisterMiddleware(object): |
| 8 | 9 | ||
| 9 | def process_view(self, request, view_func, view_args, view_kwargs): | 10 | def process_view(self, request, view_func, view_args, view_kwargs): |
| 11 | + if not settings.BROWSERID_ENABLED: | ||
| 12 | + return | ||
| 10 | 13 | ||
| 11 | if request.is_ajax(): | 14 | if request.is_ajax(): |
| 12 | return | 15 | return |