agdsn / pycroft

The AG DSN management system
Apache License 2.0
19 stars 9 forks source link

user_memberships_query sometimes returns [None] #654

Open agdsn-sentry[bot] opened 1 year ago

agdsn-sentry[bot] commented 1 year ago

Sentry Issue: PYCROFT-5N

ValidationError: 1 validation error for MembershipRow
denies.0
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.0.3/v/string_type
(2 additional frame(s) were not displayed)
...
  File "__init__.py", line 298, in error_router
    return original_handler(e)
  File "flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "web/blueprints/user/__init__.py", line 459, in user_show_groups_json
    items=[
  File "web/blueprints/user/__init__.py", line 460, in <listcomp>
    MembershipRow(
lukasjuhrich commented 1 year ago

f51c1fc was a workaround, the proper fix would fix the query (so that it does not return [None] when nothing is denied)