Commit 9c94f194 by Tim Babych Committed by Oleg Marshev

imrov

parent 34ada8a2
......@@ -39,7 +39,7 @@ class Note(models.Model):
raise ValidationError('Note must have a course_id and usage_id and user_id.')
ranges = note.get('ranges')
if ranges is None:
if not ranges:
raise ValidationError('Note must contain at least one range.')
self.ranges = json.dumps(ranges)
......
......@@ -176,8 +176,7 @@ class AnnotationViewTests(BaseAnnotationViewTests):
"""
Ensure we can get an existing annotation.
"""
note = self.payload
note_id = self._create_annotation(**note)['id']
note_id = self._create_annotation(**self.payload)['id']
url = reverse('api:v1:annotations_detail', kwargs={'annotation_id': note_id})
response = self.client.get(url, self.headers)
......
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