louking / members

member activity management
Other
1 stars 2 forks source link

Facebook aliases view: AttributeError: 'NoneType' object has no attribute 'middle_name' #598

Open louking opened 3 weeks ago

louking commented 3 weeks ago
Message type:       ERROR
Location:           /var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py:838](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py:838)
Module:             app
Function:           log_exception
Time:               2024-10-16 13:09:17,479
User:               [sweber0126@gmail.com](mailto:sweber0126@gmail.com)

Message:

Exception on /admin/fsrc/facebookaliases [GET]

Traceback (most recent call last):
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask_security/decorators.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask_security/decorators.py)", line 429, in decorated_view
    return current_app.ensure_sync(fn)(*args, **kwargs)
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py)", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py)", line 191, in dispatch_request
    return current_app.ensure_sync(meth)(**kwargs)  # type: ignore[no-any-return]
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py)", line 2810, in get
    return super(DbCrudApi, self).get()
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py)", line 1264, in get
    return self._renderpage()
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py)", line 992, in _renderpage
    thisentry = self.nexttablerow()
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py)", line 2899, in nexttablerow
    return self.dte.get_response_data(dbrecord)
  File "/var/www/[www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py](http://www.members.loutilities.com/venv/lib/python3.9/site-packages/loutilities/tables.py)", line 370, in get_response_data
    data[key] = callback(dbentry)
  File "/var/www/[www.members.loutilities.com/members/members/members/views/admin/membership_admin.py](http://www.members.loutilities.com/members/members/members/views/admin/membership_admin.py)", line 354, in get
    memberage = get_memberdob(memberalias.member)
  File "/var/www/[www.members.loutilities.com/members/members/members/views/admin/membership_admin.py](http://www.members.loutilities.com/members/members/members/views/admin/membership_admin.py)", line 332, in get_memberdob
    middlename = f'{member.middle_name} ' if member.middle_name else ''
AttributeError: 'NoneType' object has no attribute 'middle_name'
louking commented 3 weeks ago

This was a data error which can be seen in membertility-2024-10-16.sql

It's not clear how this occurred but should be prevented.