Skip to content
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

random error on the staging machine #386

Open
btbonval opened this issue Jan 9, 2015 · 1 comment
Open

random error on the staging machine #386

btbonval opened this issue Jan 9, 2015 · 1 comment
Labels

Comments

@btbonval
Copy link
Member

btbonval commented Jan 9, 2015

2015-01-09T22:34:27.494976+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 113, in get_response
2015-01-09T22:34:27.494981+00:00 app[web.1]:   File "/app/karmaworld/apps/courses/views.py", line 323, in course_list_ajax
2015-01-09T22:34:27.494983+00:00 app[web.1]:   File "/app/karmaworld/utils/ajax_utils.py", line 17, in ajax_base
2015-01-09T22:34:27.494982+00:00 app[web.1]:     return ajax_base(request, course_list_ajax_handler, ['GET'])
2015-01-09T22:34:27.494977+00:00 app[web.1]:     response = callback(request, *callback_args, **callback_kwargs)
2015-01-09T22:34:27.494985+00:00 app[web.1]:     resp = event_processor(request)
2015-01-09T22:34:27.494987+00:00 app[web.1]:     ] for course in objects
2015-01-09T22:34:27.494979+00:00 app[web.1]:     return wrapped(*args, **kwargs)
2015-01-09T22:34:27.494991+00:00 app[web.1]: AttributeError: 'NoneType' object has no attribute 'school'
2015-01-09T22:34:27.494989+00:00 app[web.1]:   File "/app/karmaworld/apps/courses/views.py", line 245, in course_json
2015-01-09T22:34:27.494990+00:00 app[web.1]:     'school': course.school.name if course.school else course.department.school.name,
2015-01-09T22:34:27.494986+00:00 app[web.1]:   File "/app/karmaworld/apps/courses/views.py", line 309, in course_list_ajax_handler
@btbonval
Copy link
Member Author

btbonval commented Jan 9, 2015

might be a fluke, happened around when I shut down the system. Looking at the code, it looks like the only way the error could appear is if course_json is called when an empty course (None) or the course has neither school nor department.
https://github.com/FinalsClub/karmaworld/blob/master/karmaworld/apps/courses/views.py#L245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant