Skip to content

incidents.html : 'NoneType' object is not iterable #1

@LUCIFERsDen26

Description

@LUCIFERsDen26

Hello!, I ran you project and great work BTW!
but had this issue and i don't know how can i slove this,
i'm new in flask keycloak.
please help.

INFO:werkzeug:127.0.0.1 - - [13/Mar/2024 11:53:38] "GET /incidents?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 304 -
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): localhost:6000
DEBUG:urllib3.connectionpool:http://localhost:6000 "GET /api/incidents HTTP/1.1" 200 5
INFO:werkzeug:127.0.0.1 - - [13/Mar/2024 11:53:39] "GET /incidents HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/app.py", line 1488, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/app.py", line 1466, in wsgi_app
    response = self.handle_exception(e)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/app.py", line 1463, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/app.py", line 872, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/frontend.py", line 96, in inner
    return func(*args, **kwargs)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/frontend.py", line 195, in incidents
    return render_template("incidents.html", incidents=events, user=id_token)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/templating.py", line 150, in render_template
    return _render(app, template, context)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/flask/templating.py", line 131, in _render
    rv = template.render(context)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/.venv/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/bhushan/Documents/IDAN/oauth2-example-main/templates/incidents.html", line 42, in top-level template code
    {% for incident in incidents %}
TypeError: 'NoneType' object is not iterable

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