Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
BGR-1895: Repeat description update bugfix for V2 serializer/API.
Browse files Browse the repository at this point in the history
  • Loading branch information
ottonomy committed Apr 18, 2018
1 parent 006c669 commit 1bcd3c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/issuer/serializers_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class BadgeClassSerializerV2(DetailSerializerV2, OriginalJsonSerializerMixin):

name = StripTagsCharField(max_length=1024)
image = ValidImageField(required=False)
description = StripTagsCharField(max_length=16384, required=True, source='description_nonnull')
description = StripTagsCharField(max_length=16384, required=True, convert_null=True)

criteriaUrl = StripTagsCharField(source='criteria_url', required=False, allow_null=True, validators=[URLValidator()])
criteriaNarrative = MarkdownCharField(source='criteria_text', required=False, allow_null=True)
Expand Down
2 changes: 2 additions & 0 deletions apps/issuer/tests/test_badgeclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,13 @@ def test_can_create_and_update_badgeclass_with_alignments_v2(self):
}
]
new_badgeclass['alignments'] = reordered_alignments
new_badgeclass['description'] = 'refreshed description'

response = self.client.put(new_badgeclass_url, new_badgeclass, format="json")
updated_badgeclass = json.loads(response.content).get('result')[0]
self.assertEqual(response.status_code, 200)
self.assertEqual(updated_badgeclass.get('alignments', None), reordered_alignments)
self.assertEqual(updated_badgeclass.get('description', None), 'refreshed description')

# make sure response we got from PUT matches what we get from GET
response = self.client.get(new_badgeclass_url)
Expand Down

0 comments on commit 1bcd3c4

Please sign in to comment.