Commit fd24ee4c990eaa036f67ead51ed4ef17eda4cfab
Committed by
Sergio Oliveira
1 parent
080cb1eb
Exists in
master
and in
31 other branches
Fixed flake8
Showing
10 changed files
with
22 additions
and
18 deletions
Show diff stats
colab/accounts/views.py
| 1 | 1 | # encoding: utf-8 |
| 2 | 2 | from collections import OrderedDict |
| 3 | 3 | |
| 4 | -from django.conf import settings | |
| 5 | 4 | from django.contrib import messages |
| 6 | -from django.db import transaction | |
| 7 | 5 | from django.db.models import Count |
| 8 | 6 | from django.contrib.auth import get_user_model |
| 9 | 7 | from django.utils.translation import ugettext as _ |
| 10 | -from django.shortcuts import render, redirect, get_object_or_404 | |
| 8 | +from django.shortcuts import render, redirect | |
| 11 | 9 | from django.core.urlresolvers import reverse |
| 12 | 10 | from django.core.exceptions import PermissionDenied |
| 13 | -from django.views.generic import DetailView, UpdateView, TemplateView | |
| 11 | +from django.views.generic import DetailView, UpdateView | |
| 14 | 12 | from django.http import Http404 |
| 15 | 13 | |
| 16 | 14 | from colab.super_archives.models import (EmailAddress, |
| ... | ... | @@ -18,8 +16,7 @@ from colab.super_archives.models import (EmailAddress, |
| 18 | 16 | from colab.search.utils import get_collaboration_data, get_visible_threads |
| 19 | 17 | from colab.accounts.models import User |
| 20 | 18 | |
| 21 | -from .forms import (UserCreationForm, UserForm, ListsForm, | |
| 22 | - UserUpdateForm) | |
| 19 | +from .forms import (UserCreationForm, ListsForm, UserUpdateForm) | |
| 23 | 20 | from .utils import mailman |
| 24 | 21 | |
| 25 | 22 | ... | ... |
colab/home/context_processors.py
colab/plugins/mezuro/__init__.py
colab/plugins/mezuro/admin.py
colab/plugins/mezuro/apps.py
| 1 | -from django.utils.translation import ugettext_lazy as _ | |
| 1 | +# from django.utils.translation import ugettext_lazy as _ | |
| 2 | 2 | from ..utils.apps import ColabProxiedAppConfig |
| 3 | 3 | |
| 4 | + | |
| 4 | 5 | class ProxyMezuroAppConfig(ColabProxiedAppConfig): |
| 5 | 6 | name = 'colab.plugins.mezuro' |
| 6 | 7 | verbose_name = 'Mezuro Proxy' | ... | ... |
colab/plugins/mezuro/models.py
colab/plugins/mezuro/tests.py
colab/plugins/mezuro/views.py
colab/search/forms.py
| ... | ... | @@ -107,10 +107,11 @@ class ColabSearchForm(SearchForm): |
| 107 | 107 | # http://wiki.apache.org/solr/FunctionQuery#Date_Boosting |
| 108 | 108 | 'bf': 'recip(ms(NOW/HOUR,modified),3.16e-11,1,1)^10', |
| 109 | 109 | } |
| 110 | + hayString = 'haystack.backends.whoosh_backend.WhooshEngine' | |
| 111 | + if settings.HAYSTACK_CONNECTIONS['default']['ENGINE'] != hayString: | |
| 112 | + sqs = sqs.filter(content=AltParser( | |
| 113 | + 'edismax', q, **dismax_opts)) | |
| 110 | 114 | |
| 111 | - if settings.HAYSTACK_CONNECTIONS['default']['ENGINE'] != \ | |
| 112 | - 'haystack.backends.whoosh_backend.WhooshEngine': | |
| 113 | - sqs = sqs.filter(content=AltParser('edismax', q, **dismax_opts)) | |
| 114 | 115 | else: |
| 115 | 116 | sqs = sqs.filter(content=AutoQuery(q)) |
| 116 | 117 | ... | ... |
colab/search/tests.py
| ... | ... | @@ -21,11 +21,14 @@ class SearchViewTest(TestCase): |
| 21 | 21 | |
| 22 | 22 | self.assertEqual(3, len(thread_list)) |
| 23 | 23 | |
| 24 | - condition = any('This is a repply to Thread 1 on list A' in t.description for t in thread_list) | |
| 24 | + condition = any('This is a repply to Thread 1 on list A' in | |
| 25 | + t.description for t in thread_list) | |
| 25 | 26 | self.assertTrue(condition) |
| 26 | - condition = any('This is a repply to Thread 1 on list B' in t.description for t in thread_list) | |
| 27 | + condition = any('This is a repply to Thread 1 on list B' in | |
| 28 | + t.description for t in thread_list) | |
| 27 | 29 | self.assertTrue(condition) |
| 28 | - condition = any('This is a repply to Thread 1 on list C' in t.description for t in thread_list) | |
| 30 | + condition = any('This is a repply to Thread 1 on list C' in | |
| 31 | + t.description for t in thread_list) | |
| 29 | 32 | self.assertTrue(condition) |
| 30 | 33 | |
| 31 | 34 | def test_search_account_by_firstName(self): | ... | ... |