Closed vladimirmyshkovski closed 5 years ago
I found that the error in the river/admin/proceeding_meta.py
def get_content_types():
content_type_pks = []
ctt = ContentType.objects.all()
for ct in ContentType.objects.all():
model = ct.model_class() # <- HERE
for f in model._meta.fields:
if type(f) is StateField:
content_type_pks.append(ct.pk)
return content_type_pks
When there is parsing the content_type
, and it encounters an admin
, he can not get his model_class ().
I have not figured out how to solve it correctly, but just adding :
if not model:
continue
Everything worked as expected
Also, in Django 1.11.1 there is a command remove_stale_contenttypes
, the implementation of which solves this problem
Just you commented, it works fine.
def get_content_types():
content_type_pks = []
for ct in ContentType.objects.all():
model = ct.model_class()
if not model:
continue
for f in model._meta.fields:
if type(f) is StateField:
content_type_pks.append(ct.pk)
return content_type_pks
When I try add processing meta, I get error:
and get 2 warnings:
Django version 1.11.1