Commit 38abf01c by Tim Babych

imrov

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