-
Notifications
You must be signed in to change notification settings - Fork 37
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
Refactor: Moved a number of edx-platform imports to figures.compat #313
Conversation
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. Thanks John!
@@ -1,7 +1,9 @@ | |||
"""Figures compatability module | |||
|
|||
This module serves to provide a common access point to functionality that | |||
differs from different named Open edX releases | |||
This module serves to provide a common access point to edx-platform objects. |
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.
Nit: The module can now be called openedx
instead of compat
to reflect the newer name imho.
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.
Good idea, I'll do that during another refactor
@@ -116,6 +116,8 @@ class SiteDailyMetrics(TimeStampedModel): | |||
# Should change this to default value of 0 | |||
mau = models.IntegerField(blank=True, null=True) | |||
|
|||
# TODO: Add field for number of CDMs reported |
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.
Nit: This doesn't seem to be related to the pull request overall. Was it added by mistake?
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.
Nope, on purpose, a reminder while I was in the code
@@ -241,3 +241,25 @@ def student_modules_for_course_enrollment(ce): | |||
Relies on the fact that course_ids are globally unique | |||
""" | |||
return StudentModule.objects.filter(student=ce.user, course_id=ce.course_id) | |||
|
|||
|
|||
def site_certificates(site): |
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.
Nit: This function doesn't seem to be both unused and unrelated to the pull request. Was it added by mistake?
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.
Not added by mistake, just a little extra that I remembered I wanted in there as I was refactoring
tests/test_sites.py
Outdated
# from openedx.core.djangoapps.content.course_overviews.models import ( | ||
# CourseOverview, | ||
# ) |
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.
Nit: Probably not needed.
# from openedx.core.djangoapps.content.course_overviews.models import ( | |
# CourseOverview, | |
# ) |
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 removed this dead code. Thanks!
Improved abstraction: This commit refactors how Figures imports edx-platform classes. It centralizes imports to figures.compat. The rest of Figures then imports the platform classes from figures.compat. This is preliminary work to help abstract platform dependencies for Open edX named release structures and improve future testing efforts
a55cd9b
to
5c2dcd2
Compare
Improved abstraction: This commit refactors how Figures imports edx-platform classes. It centralizes imports to figures.compat. The rest of Figures then imports the platform classes from figures.compat.
This is preliminary work to help abstract platform dependencies for Open edX named release structures and improve future testing efforts
Also bumped Figures release version to 0.4.dev7