Невозможно удалить элемент из интерфейса администратора Django
Мы использовали интерфейс администратора Django для создания некоторого содержимого (модель 'Talk') и загрузки файла. Загрузка не удалась с ошибкой Server Timeout Error (500)
.
Теперь мы не можем удалить или даже нажать на разговор в интерфейсе администратора. См. скриншот:
Когда мы нажимаем на элемент, мы получаем сообщение Server Error (500)
и Django выводит следующее в наши журналы:
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'
Когда мы пытаемся удалить элемент, мы получаем немного другую ошибку:
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
Мы используем Django версии 2.1.15 с Python 3.8.