Commit a7b3f092 by Tim Babych

pep8

parent 8d8df6de
from haystack import indexes
from .models import Note
class NoteIndex(indexes.SearchIndex, indexes.Indexable):
user = indexes.CharField(model_attr='user_id', indexed=False)
course_id = indexes.CharField(model_attr='course_id', indexed=False)
......
......@@ -46,4 +46,4 @@ class NoteTest(TestCase):
with self.assertRaises(ValidationError):
note = Note.create(payload)
note.full_clean()
\ No newline at end of file
note.full_clean()
......@@ -433,9 +433,7 @@ class AnnotationViewTests(BaseAnnotationViewTests):
Tests list all annotations.
"""
for i in xrange(5):
kwargs = {'text': 'Foo_{}'.format(i),
}
kwargs = {'text': 'Foo_{}'.format(i)}
self._create_annotation(**kwargs)
url = reverse('api:v1:annotations')
......
......@@ -25,7 +25,7 @@ class AnnotationSearchView(APIView):
"""
params = self.request.QUERY_PARAMS.dict()
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')
if params.get('highlight'):
......
......@@ -34,8 +34,8 @@ def get_logger_config(log_dir='/var/tmp',
"[%(name)s][env:{logging_env}] %(levelname)s "
"[{hostname} %(process)d] [%(filename)s:%(lineno)d] "
"- %(message)s").format(
service_variant=service_variant,
logging_env=logging_env, hostname=hostname)
service_variant=service_variant,
logging_env=logging_env, hostname=hostname)
if debug:
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