diff --git a/lms/templates/admin/base_site.html b/lms/templates/admin/base_site.html index e274c8e006b7..2dfd0bef7a50 100644 --- a/lms/templates/admin/base_site.html +++ b/lms/templates/admin/base_site.html @@ -23,4 +23,4 @@

{{ site_header|default:_('D {% block messages %}{{ block.super }} {% include "survey_report/admin_banner.html" %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/openedx/features/survey_report/admin.py b/openedx/features/survey_report/admin.py index 917a6e437f2e..8d4652282b5f 100644 --- a/openedx/features/survey_report/admin.py +++ b/openedx/features/survey_report/admin.py @@ -85,9 +85,11 @@ def report_state(self, obj): Method to define the custom State column with the new "send" state, to avoid modifying the current models. """ - if obj.surveyreportupload_set.last().is_uploaded(): - return "Sent" - return obj.state.capitalize() + try: + if obj.surveyreportupload_set.last().is_uploaded(): + return "Sent" + except AttributeError: + return obj.state.capitalize() report_state.short_description = 'State' admin.site.register(SurveyReport, SurveyReportAdmin)