louking / contracts

1 stars 2 forks source link

AttributeError: 'NoneType' object has no attribute 'rule' /admin/_checkdate #478

Open louking opened 3 months ago

louking commented 3 months ago

Message type:       ERROR
        Location:           /var/www/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py:838](http://sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py:838)
        Module:             app
        Function:           log_exception
        Time:               2024-08-16 08:49:34,006

        Message:

        Exception on /admin/_checkdate [GET]

Traceback (most recent call last):
  File "/var/www/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://sandbox.contracts.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/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://sandbox.contracts.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/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask_login/utils.py](http://sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask_login/utils.py)", line 290, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/var/www/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py](http://sandbox.contracts.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/[sandbox.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py](http://sandbox.contracts.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/[sandbox.contracts.loutilities.com/contracts/contracts/contracts/views/admin/events.py](http://sandbox.contracts.loutilities.com/contracts/contracts/contracts/views/admin/events.py)", line 755, in get
    daterule_dates = daterule2dates(daterule, year)
  File "/var/www/[sandbox.contracts.loutilities.com/contracts/contracts/contracts/daterule.py](http://sandbox.contracts.loutilities.com/contracts/contracts/contracts/daterule.py)", line 61, in daterule2dates
    if rule.rule in rulex:
AttributeError: 'NoneType' object has no attribute 'rule'