Commit 4c424e9fc277558725f3257f9e334d1ac0c73e08
1 parent
cab2b14d
Exists in
master
and in
3 other branches
Review files using flake8
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com> Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com>
Showing
3 changed files
with
12 additions
and
9 deletions
Show diff stats
src/colab_spb/middleware.py
| 1 | from django.conf import settings | 1 | from django.conf import settings |
| 2 | from django.utils import translation | 2 | from django.utils import translation |
| 3 | 3 | ||
| 4 | + | ||
| 4 | class ForceLangMiddleware: | 5 | class ForceLangMiddleware: |
| 5 | 6 | ||
| 6 | - def process_request(self,request): | ||
| 7 | - request.LANG = getattr(settings,'LANGUAGE_CODE',settings.LANGUAGE_CODE) | 7 | + def process_request(self, request): |
| 8 | + request.LANG = getattr(settings, 'LANGUAGE_CODE', | ||
| 9 | + settings.LANGUAGE_CODE) | ||
| 8 | translation.activate(request.LANG) | 10 | translation.activate(request.LANG) |
| 9 | request.LANGUAGE_CODE = request.LANG | 11 | request.LANGUAGE_CODE = request.LANG |
tests/colab_settings.py
| 1 | 1 | ||
| 2 | -## Set to false in production | 2 | +# Set to false in production |
| 3 | DEBUG = True | 3 | DEBUG = True |
| 4 | TEMPLATE_DEBUG = False | 4 | TEMPLATE_DEBUG = False |
| 5 | 5 | ||
| 6 | -## System admins | 6 | +# System admins |
| 7 | ADMINS = [['John Foo', 'john@example.com'], ['Mary Bar', 'mary@example.com']] | 7 | ADMINS = [['John Foo', 'john@example.com'], ['Mary Bar', 'mary@example.com']] |
| 8 | 8 | ||
| 9 | MANAGERS = ADMINS | 9 | MANAGERS = ADMINS |
| @@ -19,15 +19,15 @@ SECRET_KEY = 'not-a-secret' | @@ -19,15 +19,15 @@ SECRET_KEY = 'not-a-secret' | ||
| 19 | 19 | ||
| 20 | ALLOWED_HOSTS = [ | 20 | ALLOWED_HOSTS = [ |
| 21 | 'localhost', | 21 | 'localhost', |
| 22 | -# 'example.com', | ||
| 23 | -# 'example.org', | ||
| 24 | -# 'example.net', | 22 | + # 'example.com', |
| 23 | + # 'example.org', | ||
| 24 | + # 'example.net', | ||
| 25 | ] | 25 | ] |
| 26 | 26 | ||
| 27 | -### Uncomment to enable social networks fields profile | 27 | +# Uncomment to enable social networks fields profile |
| 28 | SOCIAL_NETWORK_ENABLED = True | 28 | SOCIAL_NETWORK_ENABLED = True |
| 29 | 29 | ||
| 30 | -## Disable indexing | 30 | +# Disable indexing |
| 31 | ROBOTS_NOINDEX = True | 31 | ROBOTS_NOINDEX = True |
| 32 | 32 | ||
| 33 | LOGGING = { | 33 | LOGGING = { |
tests/runtests.py
| @@ -6,6 +6,7 @@ import django | @@ -6,6 +6,7 @@ import django | ||
| 6 | from django.conf import settings | 6 | from django.conf import settings |
| 7 | from django.test.utils import get_runner | 7 | from django.test.utils import get_runner |
| 8 | 8 | ||
| 9 | + | ||
| 9 | def run(): | 10 | def run(): |
| 10 | os.environ['DJANGO_SETTINGS_MODULE'] = 'colab.settings' | 11 | os.environ['DJANGO_SETTINGS_MODULE'] = 'colab.settings' |
| 11 | os.environ['COLAB_PLUGINS'] = 'tests/plugins.d' | 12 | os.environ['COLAB_PLUGINS'] = 'tests/plugins.d' |