Skip to content

Make CMS user view not show ErrorDescriptor courses#635

Merged
chrisndodge merged 1 commit intomasterfrom
bugfix/ichuang/cms-user-view-if-bad-course
Aug 12, 2013
Merged

Make CMS user view not show ErrorDescriptor courses#635
chrisndodge merged 1 commit intomasterfrom
bugfix/ichuang/cms-user-view-if-bad-course

Conversation

@ichuang
Copy link
Contributor

@ichuang ichuang commented Aug 11, 2013

If a bad course gets into the mongodb, then it crashes the CMS user view showing the list of courses.

This PR fixes this by suppressing courses which are ErrorDescriptor instances.

Someday in the future, it may be desirable to make ErrorDescriptor instances show up with red flags to staff.

@chrisndodge
Copy link
Contributor

Curious, can you forward what the stack trace on the original exception was?

@ichuang
Copy link
Contributor Author

ichuang commented Aug 11, 2013

Traceback:
File "/home/mitx/mitx_all/python/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/mitx/mitx_all/edx-platform/cms/djangoapps/contentstore/views/public.py" in howitworks
  49.         return index(request)
File "/home/mitx/mitx_all/python/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  20.                 return view_func(request, *args, **kwargs)
File "/home/mitx/mitx_all/python/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/mitx/mitx_all/edx-platform/cms/djangoapps/contentstore/views/user.py" in index
  67.         'courses': [format_course_for_view(c) for c in courses ],
File "/home/mitx/mitx_all/edx-platform/cms/djangoapps/contentstore/views/user.py" in format_course_for_view
  60.             course.display_org_with_default,

Exception Type: AttributeError at /
Exception Value: 'ErrorDescriptor' object has no attribute 'display_org_with_default'

chrisndodge pushed a commit that referenced this pull request Aug 12, 2013
…course

Make CMS user view not show ErrorDescriptor courses
@chrisndodge chrisndodge merged commit a864656 into master Aug 12, 2013
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
more template updates to rename MITx to edX
itsjeyd referenced this pull request in open-craft/openedx-platform Mar 1, 2016
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Apr 19, 2016
jenkins-ks pushed a commit to nttks/edx-platform that referenced this pull request Apr 19, 2016
caesar2164 pushed a commit to caesar2164/edx-platform that referenced this pull request Feb 21, 2018
* stv/unfork/sneak-peek:
  Split out CMS sneakpeek middleware
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants