Cannot delete an item from the Django admin interface
We used the Django admin interface to create some content (a 'Talk' model) and upload a file. The upload failed with a Server Timeout Error (500)
.
Now, we cannot delete or even click on the talk in the admin interface. See screenshot:
When we click on the item, we get a Server Error (500)
message and Django outputs the following to our log files:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 850, in _resolve_lookup
(bit, current)) # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [non_field_errors] in None
DEBUG 2021-10-23 07:29:00,382 base 128 140297891723008 Exception while resolving variable 'non_field_errors' in template 'admin/change_list.html'.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 829, in _resolve_lookup
current = current[bit]
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 837, in _resolve_lookup
current = getattr(current, bit)
AttributeError: 'NoneType' object has no attribute 'non_field_errors'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 843, in _resolve_lookup
current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'non_field_errors'
When we try to delete the item, we receive a slightly different error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 843, in _resolve_lookup
current = current[int(bit)]
ValueError: invalid literal for int() with base 10: 'non_field_errors'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 850, in _resolve_lookup
(bit, current)) # missing attribute
django.template.base.VariableDoesNotExist: Failed lookup for key [non_field_errors] in None
DEBUG 2021-10-23 07:21:19,130 base 128 140297916901120 Exception while resolving variable 'non_field_errors' in template 'admin/change_list.html'.
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/django/template/base.py", line 829, in _resolve_lookup
current = current[bit]
TypeError: 'NoneType' object is not subscriptable
We are using Django version 2.1.15 with Python 3.8.