-
Notifications
You must be signed in to change notification settings - Fork 85
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
✨(backend) add offer and price fields to courseRun #2466
base: master
Are you sure you want to change the base?
✨(backend) add offer and price fields to courseRun #2466
Conversation
d08ad9e
to
dde2d06
Compare
@@ -623,6 +623,8 @@ def test_models_course_run_mark_dirty_any_field(self): | |||
stub = CourseRunFactory( | |||
sync_mode="manual", | |||
catalog_visibility=CourseRunCatalogVisibility.COURSE_ONLY, | |||
offer=CourseRunOffer.SUBSCRIPTION, |
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.
@JoaoGarcao You have to use the setting RICHIE_DEFAULT_COURSE_RUN_OFFER
that you have added to to the settings.py
@JoaoGarcao to fix the |
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.
Do not forgot to add an entry into the changelog.
@@ -75,6 +75,8 @@ class Meta: | |||
"state", | |||
"enrollment_count", | |||
"catalog_visibility", | |||
"offer", | |||
"price", |
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.
price
field could be returned as a float not a string.
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.
I've made a change to this, but I'm not sure if it's in line with what you asked for.
sandbox/settings.py
Outdated
RICHIE_DEFAULT_COURSE_RUN_OFFER = values.Value( | ||
"free", | ||
environ_name="RICHIE_DEFAULT_COURSE_RUN_OFFER", | ||
environ_prefix=None, | ||
) | ||
|
||
# Course run price currency value that would be shown on course detail page | ||
RICHIE_DEFAULT_COURSE_RUN_PRICE_CURRENCY = values.Value( | ||
"EUR", | ||
environ_name="RICHIE_DEFAULT_COURSE_RUN_PRICE_CURRENCY", | ||
environ_prefix=None, | ||
) | ||
|
||
# Course run price value that would be shown on course detail page | ||
RICHIE_DEFAULT_COURSE_RUN_PRICE = values.Value( | ||
0.0, | ||
environ_name="RICHIE_DEFAULT_COURSE_RUN_PRICE", | ||
environ_prefix=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.
RICHIE_DEFAULT_COURSE_RUN_OFFER
and RICHIE_DEFAULT_COURSE_RUN_PRICE
look not used. Furthermore, I wonder if this is really useful to be able to override to default values through a settings. WDYT?
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.
I agree that the RICHIE_DEFAULT_COURSE_RUN_PRICE
shouldn't be on a setting.
@JoaoGarcao the RICHIE_DEFAULT_COURSE_RUN_OFFER
should be included only on the next PR that you are working.
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.
Change done.
84083cc
to
78b87af
Compare
Add offer and price fields to courseRun displayed at admin view related to openfun#2445
78b87af
to
8ee54a1
Compare
Add offer and price fields to courseRun displayed at admin view
related to #2445
1º task requested on issue #2451