diff --git a/colab/accounts/views.py b/colab/accounts/views.py index 70202f1..280b35f 100644 --- a/colab/accounts/views.py +++ b/colab/accounts/views.py @@ -1,16 +1,14 @@ # encoding: utf-8 from collections import OrderedDict -from django.conf import settings from django.contrib import messages -from django.db import transaction from django.db.models import Count from django.contrib.auth import get_user_model from django.utils.translation import ugettext as _ -from django.shortcuts import render, redirect, get_object_or_404 +from django.shortcuts import render, redirect from django.core.urlresolvers import reverse from django.core.exceptions import PermissionDenied -from django.views.generic import DetailView, UpdateView, TemplateView +from django.views.generic import DetailView, UpdateView from django.http import Http404 from colab.super_archives.models import (EmailAddress, @@ -18,8 +16,7 @@ from colab.super_archives.models import (EmailAddress, from colab.search.utils import get_collaboration_data, get_visible_threads from colab.accounts.models import User -from .forms import (UserCreationForm, UserForm, ListsForm, - UserUpdateForm) +from .forms import (UserCreationForm, ListsForm, UserUpdateForm) from .utils import mailman diff --git a/colab/home/context_processors.py b/colab/home/context_processors.py index 7630cb8..a569bee 100644 --- a/colab/home/context_processors.py +++ b/colab/home/context_processors.py @@ -25,4 +25,3 @@ def ribbon(request): 'url': getattr(settings, 'RIBBON_URL', url), } } - diff --git a/colab/plugins/mezuro/__init__.py b/colab/plugins/mezuro/__init__.py index b937315..58fef2c 100644 --- a/colab/plugins/mezuro/__init__.py +++ b/colab/plugins/mezuro/__init__.py @@ -1 +1,3 @@ -default_app_config = 'colab.plugins.mezuro.apps.ProxyMezuroAppConfig' \ No newline at end of file + + +default_app_config = 'colab.plugins.mezuro.apps.ProxyMezuroAppConfig' diff --git a/colab/plugins/mezuro/admin.py b/colab/plugins/mezuro/admin.py index 8c38f3f..4185d36 100644 --- a/colab/plugins/mezuro/admin.py +++ b/colab/plugins/mezuro/admin.py @@ -1,3 +1,3 @@ -from django.contrib import admin +# from django.contrib import admin # Register your models here. diff --git a/colab/plugins/mezuro/apps.py b/colab/plugins/mezuro/apps.py index c4c5436..59b3ece 100644 --- a/colab/plugins/mezuro/apps.py +++ b/colab/plugins/mezuro/apps.py @@ -1,6 +1,7 @@ -from django.utils.translation import ugettext_lazy as _ +# from django.utils.translation import ugettext_lazy as _ from ..utils.apps import ColabProxiedAppConfig + class ProxyMezuroAppConfig(ColabProxiedAppConfig): name = 'colab.plugins.mezuro' verbose_name = 'Mezuro Proxy' diff --git a/colab/plugins/mezuro/models.py b/colab/plugins/mezuro/models.py index 71a8362..0b4331b 100644 --- a/colab/plugins/mezuro/models.py +++ b/colab/plugins/mezuro/models.py @@ -1,3 +1,3 @@ -from django.db import models +# from django.db import models # Create your models here. diff --git a/colab/plugins/mezuro/tests.py b/colab/plugins/mezuro/tests.py index 7ce503c..a79ca8b 100644 --- a/colab/plugins/mezuro/tests.py +++ b/colab/plugins/mezuro/tests.py @@ -1,3 +1,3 @@ -from django.test import TestCase +# from django.test import TestCase # Create your tests here. diff --git a/colab/plugins/mezuro/views.py b/colab/plugins/mezuro/views.py index 5c5570d..355cb98 100644 --- a/colab/plugins/mezuro/views.py +++ b/colab/plugins/mezuro/views.py @@ -1,5 +1,6 @@ from ..utils.views import ColabProxyView + class MezuroProxyView(ColabProxyView): app_label = 'mezuro' diazo_theme_template = 'proxy/mezuro.html' diff --git a/colab/search/forms.py b/colab/search/forms.py index c50d3c1..f90b162 100644 --- a/colab/search/forms.py +++ b/colab/search/forms.py @@ -107,10 +107,11 @@ class ColabSearchForm(SearchForm): # http://wiki.apache.org/solr/FunctionQuery#Date_Boosting 'bf': 'recip(ms(NOW/HOUR,modified),3.16e-11,1,1)^10', } + hayString = 'haystack.backends.whoosh_backend.WhooshEngine' + if settings.HAYSTACK_CONNECTIONS['default']['ENGINE'] != hayString: + sqs = sqs.filter(content=AltParser( + 'edismax', q, **dismax_opts)) - if settings.HAYSTACK_CONNECTIONS['default']['ENGINE'] != \ - 'haystack.backends.whoosh_backend.WhooshEngine': - sqs = sqs.filter(content=AltParser('edismax', q, **dismax_opts)) else: sqs = sqs.filter(content=AutoQuery(q)) diff --git a/colab/search/tests.py b/colab/search/tests.py index 124b51f..d1ede50 100644 --- a/colab/search/tests.py +++ b/colab/search/tests.py @@ -21,11 +21,14 @@ class SearchViewTest(TestCase): self.assertEqual(3, len(thread_list)) - condition = any('This is a repply to Thread 1 on list A' in t.description for t in thread_list) + condition = any('This is a repply to Thread 1 on list A' in + t.description for t in thread_list) self.assertTrue(condition) - condition = any('This is a repply to Thread 1 on list B' in t.description for t in thread_list) + condition = any('This is a repply to Thread 1 on list B' in + t.description for t in thread_list) self.assertTrue(condition) - condition = any('This is a repply to Thread 1 on list C' in t.description for t in thread_list) + condition = any('This is a repply to Thread 1 on list C' in + t.description for t in thread_list) self.assertTrue(condition) def test_search_account_by_firstName(self): -- libgit2 0.21.2