Commit a7b3f092 by Tim Babych

pep8

parent 8d8df6de
from haystack import indexes from haystack import indexes
from .models import Note from .models import Note
class NoteIndex(indexes.SearchIndex, indexes.Indexable): class NoteIndex(indexes.SearchIndex, indexes.Indexable):
user = indexes.CharField(model_attr='user_id', indexed=False) user = indexes.CharField(model_attr='user_id', indexed=False)
course_id = indexes.CharField(model_attr='course_id', indexed=False) course_id = indexes.CharField(model_attr='course_id', indexed=False)
......
...@@ -46,4 +46,4 @@ class NoteTest(TestCase): ...@@ -46,4 +46,4 @@ class NoteTest(TestCase):
with self.assertRaises(ValidationError): with self.assertRaises(ValidationError):
note = Note.create(payload) note = Note.create(payload)
note.full_clean() note.full_clean()
\ No newline at end of file
...@@ -433,9 +433,7 @@ class AnnotationViewTests(BaseAnnotationViewTests): ...@@ -433,9 +433,7 @@ class AnnotationViewTests(BaseAnnotationViewTests):
Tests list all annotations. Tests list all annotations.
""" """
for i in xrange(5): for i in xrange(5):
kwargs = {'text': 'Foo_{}'.format(i), kwargs = {'text': 'Foo_{}'.format(i)}
}
self._create_annotation(**kwargs) self._create_annotation(**kwargs)
url = reverse('api:v1:annotations') url = reverse('api:v1:annotations')
......
...@@ -25,7 +25,7 @@ class AnnotationSearchView(APIView): ...@@ -25,7 +25,7 @@ class AnnotationSearchView(APIView):
""" """
params = self.request.QUERY_PARAMS.dict() params = self.request.QUERY_PARAMS.dict()
query = SearchQuerySet().models(Note).filter( query = SearchQuerySet().models(Note).filter(
**{f:v for (f,v) in params.items() if f in ('user', 'course_id', 'usage_id', 'text')} **{f: v for (f, v) in params.items() if f in ('user', 'course_id', 'usage_id', 'text')}
).order_by('-updated') ).order_by('-updated')
if params.get('highlight'): if params.get('highlight'):
......
...@@ -34,8 +34,8 @@ def get_logger_config(log_dir='/var/tmp', ...@@ -34,8 +34,8 @@ def get_logger_config(log_dir='/var/tmp',
"[%(name)s][env:{logging_env}] %(levelname)s " "[%(name)s][env:{logging_env}] %(levelname)s "
"[{hostname} %(process)d] [%(filename)s:%(lineno)d] " "[{hostname} %(process)d] [%(filename)s:%(lineno)d] "
"- %(message)s").format( "- %(message)s").format(
service_variant=service_variant, service_variant=service_variant,
logging_env=logging_env, hostname=hostname) logging_env=logging_env, hostname=hostname)
if debug: if debug:
handlers = ['console'] handlers = ['console']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment