Tests cleanup
authorThierry Florac <tflorac@ulthar.net>
Fri, 28 Jun 2019 15:40:59 +0200
changeset 387 604807051f00
parent 386 15801a3108dc
child 388 e768f0e1e52f
Tests cleanup
src/pyams_utils/__init__.py
--- a/src/pyams_utils/__init__.py	Fri Jun 28 15:40:27 2019 +0200
+++ b/src/pyams_utils/__init__.py	Fri Jun 28 15:40:59 2019 +0200
@@ -29,10 +29,11 @@
 def get_field_doc(self):
     """Try to get FieldProperty field docstring from field interface"""
     field = self._FieldProperty__field
-    if field.title and field.description:
-        return '{0}: {1}'.format(field.title, field.description)
-    elif field.title:
-        return field.title
+    if field.title:
+        if field.description:
+            return '{0}: {1}'.format(field.title, field.description)
+        else:
+            return field.title
     else:
         return super(self.__class__, self).__doc__