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

NoneType error — from Canterbury regionals #299

Closed
philipbelesky opened this issue Mar 12, 2016 · 1 comment
Closed

NoneType error — from Canterbury regionals #299

philipbelesky opened this issue Mar 12, 2016 · 1 comment
Labels
bugs Reported/reproduced bugs

Comments

@philipbelesky
Copy link
Member

Mental note to come back to this — I have a database dump. Seems to affect public_tournament_index.html and draw_adjudicators_edit.html pages. Doesn't seem to be due to something in the template (still wont render even with a blank template) or in the views (the public_index view just returns the template). Possibly some problem with one of the wrapper?

Trace from the public index page:

TypeError at /t/cantabregionals/
'NoneType' object is not iterable
Request Method: GET
Request URL:    http://127.0.0.1:8000/t/cantabregionals/
Django Version: 1.9.2
Exception Type: TypeError
Exception Value:    
'NoneType' object is not iterable
Exception Location: /Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py in _request_context_bind_template, line 81
Python Executable:  /Users/philip/Sites/tc_hamish/venv/bin/python3.5
Python Version: 3.5.1
Python Path:    
['/Users/philip/Sites/tc_hamish',
 '/Users/philip/.pyenv/versions/3.5.1/lib/python35.zip',
 '/Users/philip/.pyenv/versions/3.5.1/lib/python3.5',
 '/Users/philip/.pyenv/versions/3.5.1/lib/python3.5/plat-darwin',
 '/Users/philip/.pyenv/versions/3.5.1/lib/python3.5/lib-dynload',
 '/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages']
Server time:    Sat, 12 Mar 2016 15:36:49 +1100
Traceback Switch to copy-and-paste view

/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/core/handlers/base.py in get_response
                    response = self.process_exception_by_middleware(e, request) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/core/handlers/base.py in get_response
                    response = wrapped_callback(request, *callback_args, **callback_kwargs) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/utils/decorators.py in _wrapped_view
                    response = view_func(request, *args, **kwargs) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/utils/views.py in foo
        return view_fn(request, request.tournament, *args, **kwargs) ...
▼ Local vars
Variable    Value
view_fn 
<function public_index at 0x102a8aa60>
args    
()
kwargs  
{}
request 
<WSGIRequest: GET '/t/cantabregionals/'>
tournament_slug 
'cantabregionals'
/Users/philip/Sites/tc_hamish/tournaments/views.py in public_index
    return render(request, 'public_tournament_index.html') ...
▼ Local vars
Variable    Value
request 
<WSGIRequest: GET '/t/cantabregionals/'>
t   
<Tournament: Canterbury 2016>
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/shortcuts.py in render
            template_name, context, request=request, using=using) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/template/loader.py in render_to_string
        return template.render(context, request) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/template/backends/django.py in render
            return self.template.render(context) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/django/template/base.py in render
                with context.bind_template(self): ...
▶ Local vars
/Users/philip/.pyenv/versions/3.5.1/lib/python3.5/contextlib.py in __enter__
            return next(self.gen) ...
▶ Local vars
/Users/philip/Sites/tc_hamish/venv/lib/python3.5/site-packages/debug_toolbar/panels/templates/panel.py in _request_context_bind_template
            updates.update(context) ...
▶ Local vars
@philipbelesky philipbelesky added the bugs Reported/reproduced bugs label Mar 12, 2016
@philipbelesky
Copy link
Member Author

Seems to either be cache or middleware related. I just created a new view for #285 which now triggers the same error (its basically a copy+paste of the novices tab view, yet the novices tab view is fine). Have had a little look, am unclear on what exactly the object is that is expected — everything tournament_view and public_optional_tournament_view seem to need seems to be present.

czlee pushed a commit that referenced this issue Mar 18, 2016
Signed-off-by: Philip Belesky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Reported/reproduced bugs
Projects
None yet
Development

No branches or pull requests

1 participant