-
Notifications
You must be signed in to change notification settings - Fork 9
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: add fields parent_content_key and is_assigned_course_run for assignments #549
Conversation
c04bfd5
to
467ff12
Compare
migrations.AlterField( | ||
model_name='historicallearnercontentassignment', | ||
name='allocated_at', | ||
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, help_text='The last time the assignment was allocated. Cannot be null.'), | ||
), |
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] This migration is unrelated to changes I made in this PR; seems like it's a migration that was missing (i.e., auto-generated during makemigrations
).
467ff12
to
1020939
Compare
preferred_course_run_key = _get_preferred_course_run_key(assignment_configuration, content_key) | ||
is_assigned_course_run = bool(parent_content_key) |
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] Uses a non-null parent_content_key
to determine whether the assignment is run-based.
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.
LGTM 👍🏽
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.
LGTM, couple tiny suggestions!
Description:
LearnerContentAssignment
:parent_content_key
. This will represent a top-level course key when the assignment'scontent_key
is a course run. Otherwise,None
.is_assigned_course_run
. This will indicate whether the assignment is course run-based or course-based.parent_content_key
andis_assigned_course_run
in API responses.is_assigned_course_run
as a read-only field in Django Admin._get_parent_content_key
to return either a course run's parent course'scontent_key
orNone
if the providedcontent_key
is already a course run.parent_content_key
andis_assigned_course_run
during assignment object creation.Jira:
ENT-8876
Merge checklist:
./manage.py makemigrations
has been runPost merge: