OnroerendErfgoed / pyoes

PYramid Onroerend Erfgoed Style
http://pyoes.readthedocs.org/
2 stars 0 forks source link

Check inbouwen of persoonsgegevens bestaat voor het attribuut wordt gebruikt #241

Closed goessebr closed 2 years ago

goessebr commented 2 years ago

Een gebruiker die aanmeldt zonder rechten, bv onder burgerprofiel, die krijgt een 500 fout. Ook het opvragen van het /user object geeft een 500 waardoor het voor ons lastig is om die persoon verder te helpen

2022-06-24 08:39:03,937 ERROR [inventaris.views.exceptions:29][ThreadPoolExecutor-0_1] Error
Traceback (most recent call last):
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/tweens.py", line 41, in excview_tween
    response = handler(request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/router.py", line 143, in handle_request
    response = _call_view(
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/view.py", line 674, in _call_view
    response = view_callable(context, request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/config/views.py", line 151, in __call__
    return view(context, request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/config/views.py", line 170, in attr_view
    return view(context, request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/config/views.py", line 196, in predicate_wrapper
    return view(context, request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/viewderivers.py", line 319, in secured_view
    return view(context, request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/viewderivers.py", line 450, in rendered_view
    response = view_renderer.render_view(
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/renderers.py", line 443, in render_view
    return self.render_to_response(response, system, request=request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/renderers.py", line 466, in render_to_response
    result = self.render(value, system_values, request=request)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid/renderers.py", line 462, in render
    result = renderer(value, system_values)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyramid_jinja2/__init__.py", line 265, in __call__
    return template.render(system)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/inventaris/templates/waarnemingsobject.jinja2", line 39, in top-level template code
    {% set app_package = app_package|default('inventaris') %}
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/inventaris/templates/layout.jinja2", line 94, in top-level template code
    {% set login_sub_nav = [
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyoes/templates/pyoes/layout.jinja2", line 83, in top-level template code
    {% block header scoped %}
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyoes/templates/pyoes/layout.jinja2", line 84, in block 'header'
    {% include "pyoes/header.jinja2" %}
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyoes/templates/pyoes/header.jinja2", line 52, in top-level template code
    {% block main_nav %}
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/pyoes/templates/pyoes/header.jinja2", line 132, in block 'main_nav'
    {% if request.user.attributes.displayname is iterable %}
  File "/var/projects/inventaris/venv/lib/python3.8/site-packages/jinja2/environment.py", line 474, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'attributes'
claeyswo commented 2 years ago

attributes bestaat niet meer in openid

zit allemaal onder persoonsgegevens maar best gewoon over None checks inbouwen

image

claeyswo commented 2 years ago

dus check op attributes indien die er niet zijn check op persoonsgegevens

goessebr commented 2 years ago

We zitten in de inventaris nog op pyoes 0.12.6. De attributes werden verwijderd in 0.13.0. Het zal voldoende zijn om een check op persoonsgegevens in te voeren

Scope check of persoonsgegevens (en persoonsgegevens.omschrijving) bestaat voor we het gebruiken