Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError at /console/usage/editorial/stats/ : 'NoneType' object has no attribute 'days' #2250

Open
tompollard opened this issue Jun 26, 2024 · 1 comment

Comments

@tompollard
Copy link
Member

The editorial stats are currently raising a server error.

Internal Server Error: /console/usage/editorial/stats/

AttributeError at /console/usage/editorial/stats/
'NoneType' object has no attribute 'days'

Traceback:

File "/physionet/python-env/physionet/lib/python3.11/site-packages/django/core/handlers/exception.py" in inner
 55.                 response = get_response(request)

File "/physionet/python-env/physionet/lib/python3.11/site-packages/django/core/handlers/base.py" in _get_response
 197.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/physionet/python-env/physionet/lib/python3.11/site-packages/django/contrib/auth/decorators.py" in _wrapper_view
 23.                 return view_func(request, *args, **kwargs)

File "/home/physionet/physionet-build/physionet-django/console/views.py" in editorial_stats
 2113.         days = [d.days for d in y_durations if d.days >= 0]

File "/home/physionet/physionet-build/physionet-django/console/views.py" in <listcomp>
 2113.         days = [d.days for d in y_durations if d.days >= 0]

Exception Type: AttributeError at /console/usage/editorial/stats/
Exception Value: 'NoneType' object has no attribute 'days'
@tompollard
Copy link
Member Author

tompollard commented Jun 26, 2024

The following line is failing because there is a project without submission_datetime and editor_assignment_datetime.

days = [d.days for d in y_durations if d.days >= 0]

The culprit is a legacy project that at some point was switched to non-legacy:

projects = PublishedProject.objects.filter(is_legacy=False)

p = projects.filter(publish_datetime__year = 2010)
<QuerySet [<PublishedProject: CHB-MIT Scalp EEG Database v1.0.0>]>

I think we/I probably switched the legacy status so that the landing page would display citations (p.is_legacy is set to false).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant