localprojects / Civil-Debate-Wall

http://www.civildebatewall.com/
7 stars 3 forks source link

Can't display user directory with little data #6

Open Chiggins opened 9 years ago

Chiggins commented 9 years ago

Registered a new user, made them an admin through a mongo backend. Went to view the user directory, got the following exception message. I commented out line 40 in list.html and the page displays, but improperly formatted.

Exception on /admin/users [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1504, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1264, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1262, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1248, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/cahiggi/ILSTUViews/cdw/__init__.py", line 18, in decorated_view
    return fn(*args, **kwargs)
  File "/home/cahiggi/ILSTUViews/cdw/views_admin.py", line 309, in users
    page_selector='index')
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 123, in render_template
    context, ctx.app)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 107, in _render
    rv = template.render(context)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/cahiggi/ILSTUViews/cdw/templates/admin/users/list.html", line 1, in top-level template code
    {% extends "/admin/users/base.html" %}
  File "/home/cahiggi/ILSTUViews/cdw/templates/admin/users/base.html", line 1, in top-level template code
    {% extends "/layouts/admin.html" %}
  File "/home/cahiggi/ILSTUViews/cdw/templates/layouts/admin.html", line 6, in top-level template code
    {% extends "/layouts/boilerplate.html" %}
  File "/home/cahiggi/ILSTUViews/cdw/templates/layouts/boilerplate.html", line 28, in top-level template code
    {% block layout %}{% endblock -%}
  File "/home/cahiggi/ILSTUViews/cdw/templates/layouts/admin.html", line 50, in block "layout"
    {% block content %}Content{% endblock %}
  File "/home/cahiggi/ILSTUViews/cdw/templates/admin/users/list.html", line 40, in block "content"
    <td>{{ user.created.date() }}</td>
UndefinedError: 'None' has no attribute 'date'