Skip to content

Can't display some admin pages when no questions exist #5

@Chiggins

Description

@Chiggins

Clean install with hardly anything in the database. Try to go to the Debate Manager under admin, and we get the following error message:

Exception on /admin/debates [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 128, in debates_current
    ctx = do_show_question(cdw.questions.with_active(True))
  File "/home/cahiggi/ILSTUViews/cdw/services.py", line 83, in <lambda>
    return lambda value: self.with_fields_first(**{field: value})
  File "/home/cahiggi/ILSTUViews/cdw/services.py", line 63, in with_fields_first
    raise EntityNotFoundException(self.clazz.__name__, fields)
EntityNotFoundException: Could not find Question where: {'active': True}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions