diff --git a/apis_core/apis_entities/views.py b/apis_core/apis_entities/views.py index 0d0b5264b..ac25bc410 100644 --- a/apis_core/apis_entities/views.py +++ b/apis_core/apis_entities/views.py @@ -156,10 +156,12 @@ def get_context_data(self, **kwargs): context[self.context_filter_name] = self.filter context["entity"] = self.entity # model slug context["app_name"] = "apis_entities" - context["docstring"] = f"{model.__doc__}" - context["entity_create_stanbol"] = GenericEntitiesStanbolForm(self.entity) + # only consider properly formatted docstrings (PEP 257) + if '"""' in model.__doc__: + context["docstring"] = f"{model.__doc__}" + if "browsing" in settings.INSTALLED_APPS: from browsing.models import BrowsConf diff --git a/apis_core/apis_metainfo/templates/apis_metainfo/tags/class_definition.html b/apis_core/apis_metainfo/templates/apis_metainfo/tags/class_definition.html index 1307b7a29..78ecc9ee5 100644 --- a/apis_core/apis_metainfo/templates/apis_metainfo/tags/class_definition.html +++ b/apis_core/apis_metainfo/templates/apis_metainfo/tags/class_definition.html @@ -1 +1,5 @@ -{{ class_name }} +{% if docstring %} + {{ class_name }} +{% else %} + {{ class_name }} +{% endif %} diff --git a/apis_core/apis_metainfo/templates/generic_list.html b/apis_core/apis_metainfo/templates/generic_list.html index fd467055c..eab859700 100644 --- a/apis_core/apis_metainfo/templates/generic_list.html +++ b/apis_core/apis_metainfo/templates/generic_list.html @@ -29,7 +29,7 @@