-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: enrollment api to remove exam scores for multiple courses #173
Conversation
afd4870
to
e069f9d
Compare
e069f9d
to
d65a8d5
Compare
if self.context.get('course_id'): | ||
self.collect_grading_info() | ||
else: | ||
self.fields.pop('exam_scores', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields
is a cached property in DRF cached_property
, which is not predictable at all. Please pop out exam_scores
from requested_optional_field_tags
. That will be the safest way to deal with it
self.fields.pop('exam_scores', None) | |
tags = self.context.get('requested_optional_field_tags'): | |
if tags: | |
self.context['requested_optional_field_tags'] = list(set(tags) - {'exam_scores'}) |
(False, ['__all__']), | ||
(False, ['csv_export']), | ||
]) | ||
def test_learner_enrollment_serializer_exam_scores( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ great test, thank you!
d65a8d5
to
256272a
Compare
256272a
to
9db37b1
Compare
9db37b1
to
a07ef12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tehreem-sadat 👍🏼
Related Issue: #168