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

Fix index out of range error when there are no previous versions of an object #13

Merged
merged 6 commits into from
Apr 7, 2022

Conversation

dpoarch
Copy link
Contributor

@dpoarch dpoarch commented Apr 7, 2022

Fix index out of range error when there are no previous versions of an object

Traceback (most recent call last):
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django/contrib/admin/options.py", line 616, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django/contrib/admin/sites.py", line 232, in inner
    return view(request, *args, **kwargs)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django_handleref/admin.py", line 207, in history_view
    history = self.history(listing.result_list)
  File "/srv/www.peeringdb.com/venv/lib/python3.9/site-packages/django_handleref/admin.py", line 176, in history
    previous = self.version_cls(versions[0]).previous

Exception Type: IndexError at /cp/peeringdb_server/facility/11737/history/
Exception Value: list index out of range

@vegu vegu merged commit 9fd0ce7 into master Apr 7, 2022
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

Successfully merging this pull request may close these issues.

2 participants