Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 73225ec

Browse files
author
Jesse Shapiro
committed
Moving 'enabled_reports' to Django setting; updating settings/base.py
1 parent de61f86 commit 73225ec

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

analytics_data_api/v0/views/courses.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,7 @@ class ReportDownloadView(APIView):
799799
* expiration_date: The date through which the link will be valid
800800
* file_size: The size in bytes of the CSV download
801801
"""
802-
enabled_reports = (
803-
'problem_response'
804-
)
802+
enabled_reports = settings.ENABLED_REPORT_IDENTIFIERS
805803

806804
def get(self, _request, course_id, report_name):
807805
if report_name in self.enabled_reports:

analyticsdataserver/settings/base.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@
8585
########## END GENERAL CONFIGURATION
8686

8787

88-
########## MEDIA CONFIGURATION
89-
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-root
90-
MEDIA_ROOT = normpath(join(SITE_ROOT, 'media'))
91-
92-
# See: https://docs.djangoproject.com/en/dev/ref/settings/#media-url
93-
MEDIA_URL = '/media/'
94-
########## END MEDIA CONFIGURATION
95-
96-
9788
########## STATIC FILE CONFIGURATION
9889
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-root
9990
STATIC_ROOT = normpath(join(SITE_ROOT, 'assets'))
@@ -309,11 +300,12 @@
309300
# base url to generate link to user api
310301
LMS_USER_ACCOUNT_BASE_URL = None
311302

312-
# storage settings for report downloads
303+
# settings for report downloads
313304
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
314-
MEDIA_ROOT = '/edx/app/analytics_api/analytics_api/static/reports'
305+
MEDIA_ROOT = normpath(join(SITE_ROOT, 'static', 'reports'))
315306
MEDIA_URL = 'http://localhost:8100/static/reports/'
316307
COURSE_REPORT_FILE_LOCATION_TEMPLATE = '{course_id}_{report_name}.csv'
308+
ENABLED_REPORT_IDENTIFIERS = ('problem_response',)
317309

318310
########## END ANALYTICS DATA API CONFIGURATION
319311

0 commit comments

Comments
 (0)