Commits

mitar  committed a64120a

Do not hide fields with None value.

  • Participants
  • Parent commits c4b2d21
  • Branches maybe_field-fix

Comments (0)

Files changed (1)

File piston/emitters.py

                         ret[maybe_field] = _any(met_fields[maybe_field](data))
 
                     else:
-                        maybe = getattr(data, maybe_field, None)
-                        if maybe is not None:
+                        if hasattr(data, maybe_field):
+                            maybe = getattr(data, maybe_field)
                             if callable(maybe):
                                 if len(inspect.getargspec(maybe)[0]) <= 1:
                                     ret[maybe_field] = _any(maybe())