We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8bc7508 commit 1287106Copy full SHA for 1287106
django_features/custom_fields/factories.py
@@ -12,8 +12,11 @@ class Meta:
12
model = models.CustomField
13
14
@lazy_attribute
15
- def content_type(self) -> ContentType:
16
- return ContentType.objects.get_for_model(Person)
+ def content_type(self) -> ContentType | None:
+ try:
17
+ return ContentType.objects.get_for_model(Person)
18
+ except ModuleNotFoundError:
19
+ return None
20
21
field_type = models.CustomField.FIELD_TYPES.CHAR
22
identifier = "custom_field"
0 commit comments