PEP8 cleanups
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.http import Http404, HttpResponseRedirect
|
||||
|
||||
from rest_framework import generics
|
||||
from rest_framework.exceptions import ParseError
|
||||
|
||||
from rest_api.filters import MayanObjectPermissionsFilter
|
||||
|
||||
from .classes import SearchModel
|
||||
from .mixins import SearchModelMixin
|
||||
|
||||
|
||||
@@ -29,7 +26,6 @@ class APISearchView(SearchModelMixin, generics.ListAPIView):
|
||||
description: Term that will be used for the search.
|
||||
"""
|
||||
|
||||
|
||||
filter_backends = (MayanObjectPermissionsFilter,)
|
||||
|
||||
def get_queryset(self):
|
||||
@@ -85,9 +81,9 @@ class APIAdvancedSearchView(SearchModelMixin, generics.ListAPIView):
|
||||
}
|
||||
|
||||
if self.request.GET.get('_match_all', 'off') == 'on':
|
||||
global_and_search=True
|
||||
global_and_search = True
|
||||
else:
|
||||
global_and_search=False
|
||||
global_and_search = False
|
||||
|
||||
try:
|
||||
queryset, ids, timedelta = self.search_model.search(
|
||||
|
||||
@@ -15,7 +15,10 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='recentsearch',
|
||||
name='user',
|
||||
field=models.ForeignKey(editable=False, to=settings.AUTH_USER_MODEL, verbose_name='User'),
|
||||
field=models.ForeignKey(
|
||||
editable=False, to=settings.AUTH_USER_MODEL,
|
||||
verbose_name='User'
|
||||
),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
import urlparse
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.http import Http404, HttpResponseRedirect
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic.base import RedirectView
|
||||
|
||||
from common.generics import SimpleView, SingleObjectListView
|
||||
|
||||
from .classes import SearchModel
|
||||
from .forms import SearchForm, AdvancedSearchForm
|
||||
from .mixins import SearchModelMixin
|
||||
from .settings import setting_limit
|
||||
@@ -38,9 +34,9 @@ class ResultsView(SearchModelMixin, SingleObjectListView):
|
||||
# the template with the extra_context
|
||||
|
||||
if self.request.GET.get('_match_all', 'off') == 'on':
|
||||
global_and_search=True
|
||||
global_and_search = True
|
||||
else:
|
||||
global_and_search=False
|
||||
global_and_search = False
|
||||
|
||||
queryset, ids, timedelta = self.search_model.search(
|
||||
query_string=self.request.GET, user=self.request.user,
|
||||
|
||||
Reference in New Issue
Block a user