SOL-794 Detailed Enrollment Report

- added the abstract and concrete layers of enrollment report provider
- created a celery task.
-added the button in the e-commerce reports section

added the enrollment data backend

added the payment data and start writing the test cases.

updated the code with the feedback suggestions and wrote some test cases.
- all the downloadable reports are now visible in the ecommerce download section.
Pending instructor tasks is also visible in the ecommerce section

added the fields in the user profile information
changed the report store configuration key
added the new http endpoint for financial reports to add more permissions for finance_admin to access.

fix quality issues

added test cases to check csv content data

rebased with master and resolved conflicts

changed the log messages

added the changes as per code clintonb suggestions during code review

updated the test cases for the finance_admin decorator

changes suggested by clinton.

Created and moved Table level filters to the Custom Manager for the CourseEnrollment model.

ecommerce.js file was loaded twice in the instructor_dashboard.js fixed the issues

added the registration code column in the csv

added the full gender in the csv file

Update data sources and add display name translations for the report columns

fix meta name

Make sure the reports section does not appear on non whitelabel courses

pylint fixes

expand out enumerated values
This commit is contained in:
Muhammad Shoaib
2015-05-07 19:52:37 +05:00
committed by Chris Dodge
parent d94c0ab1af
commit b555c869bf
30 changed files with 1284 additions and 158 deletions

View File

@@ -198,16 +198,16 @@ class ReportStore(object):
passing in the whole dataset. Doing that for now just because it's simpler.
"""
@classmethod
def from_config(cls):
def from_config(cls, config_name):
"""
Return one of the ReportStore subclasses depending on django
configuration. Look at subclasses for expected configuration.
"""
storage_type = settings.GRADES_DOWNLOAD.get("STORAGE_TYPE")
storage_type = getattr(settings, config_name).get("STORAGE_TYPE")
if storage_type.lower() == "s3":
return S3ReportStore.from_config()
return S3ReportStore.from_config(config_name)
elif storage_type.lower() == "localfs":
return LocalFSReportStore.from_config()
return LocalFSReportStore.from_config(config_name)
def _get_utf8_encoded_rows(self, rows):
"""
@@ -242,7 +242,7 @@ class S3ReportStore(ReportStore):
self.bucket = conn.get_bucket(bucket_name)
@classmethod
def from_config(cls):
def from_config(cls, config_name):
"""
The expected configuration for an `S3ReportStore` is to have a
`GRADES_DOWNLOAD` dict in settings with the following fields::
@@ -257,8 +257,8 @@ class S3ReportStore(ReportStore):
and `AWS_SECRET_ACCESS_KEY` in settings.
"""
return cls(
settings.GRADES_DOWNLOAD['BUCKET'],
settings.GRADES_DOWNLOAD['ROOT_PATH']
getattr(settings, config_name).get("BUCKET"),
getattr(settings, config_name).get("ROOT_PATH")
)
def key_for(self, course_id, filename):
@@ -354,7 +354,7 @@ class LocalFSReportStore(ReportStore):
os.makedirs(root_path)
@classmethod
def from_config(cls):
def from_config(cls, config_name):
"""
Generate an instance of this object from Django settings. It assumes
that there is a dict in settings named GRADES_DOWNLOAD and that it has
@@ -365,7 +365,7 @@ class LocalFSReportStore(ReportStore):
STORAGE_TYPE : "localfs"
ROOT_PATH : /tmp/edx/report-downloads/
"""
return cls(settings.GRADES_DOWNLOAD['ROOT_PATH'])
return cls(getattr(settings, config_name).get("ROOT_PATH"))
def path_to(self, course_id, filename):
"""Return the full path to a given file for a given course."""