-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: support course run based assignments in credits_available, expiration, emails, etc. #561
Conversation
bd10ac0
to
628233f
Compare
…ration, emails, etc.
628233f
to
a0d5246
Compare
enterprise_access/apps/content_assignments/content_metadata_api.py
Outdated
Show resolved
Hide resolved
enterprise_access/apps/content_assignments/content_metadata_api.py
Outdated
Show resolved
Hide resolved
e11c90b
to
263dd2f
Compare
4068f6e
to
69b0ff2
Compare
if is_assigned_course_run: | ||
metadata_by_key[assignment_content_key] = course_metadata | ||
else: | ||
# if not is_assigned_course_run, we can assume it's a (legacy) course-based assignment | ||
metadata_by_key[course_key] = course_metadata |
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.
Aren't these still the same logic in each block? If the assignment is a legacy assignment, then course_key
is equivalent to assignment_content_key
, is it not?
if is_assigned_course_run: | |
metadata_by_key[assignment_content_key] = course_metadata | |
else: | |
# if not is_assigned_course_run, we can assume it's a (legacy) course-based assignment | |
metadata_by_key[course_key] = course_metadata | |
metadata_by_key[assignment_content_key] = course_metadata |
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.
@pwnage101 Ahhh, I understand now; you're absolutely correct. I pushed another commit 91ac3ab with a refactor. Let me know what you think!
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.
[inform] @pwnage101 I updated once more in cb9d27b.
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.
Just nits for the rest!
enterprise_access/apps/content_assignments/content_metadata_api.py
Outdated
Show resolved
Hide resolved
...prise_access/apps/content_assignments/management/commands/automatically_nudge_assignments.py
Outdated
Show resolved
Hide resolved
enterprise_access/apps/content_assignments/content_metadata_api.py
Outdated
Show resolved
Hide resolved
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.
Looks great overall! Couple small things we could simplify.
Description:
Relying on the update to enterprise-catalog's
get_content_metadata
REST API to return the top-level course object when passing course run key(s) to the?content_keys
query parameter and the addition ofnormalized_metadata_by_run
, this PR updates theget_content_metadata_for_assignments
method and where it's consumed to supportcredits_available
, expiration management commands, and email notifications related to assignments.Jira:
ENT-8876
Merge checklist:
./manage.py makemigrations
has been runPost merge: