[seda] Don't consider agency may be None in agency_id/name methods
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 01 Jun 2017 07:23:21 +0200
changeset 2639 5cda167cef43
parent 2638 67558c0fc5ee
child 2641 839f7bdebb14
[seda] Don't consider agency may be None in agency_id/name methods since this is handled by the caller.
cubicweb_seda/entities/profile_generation.py
--- a/cubicweb_seda/entities/profile_generation.py	Thu May 18 23:01:43 2017 +0200
+++ b/cubicweb_seda/entities/profile_generation.py	Thu Jun 01 07:23:21 2017 +0200
@@ -1103,10 +1103,10 @@
         return seq.title
 
     def agency_name(self, agency):
-        return agency.agency.dc_title() if agency and agency.agency else None
+        return agency.agency.dc_title() if agency.agency is not None else None
 
     def agency_id(self, agency):
-        return text_type(agency.agency.eid) if agency and agency.agency else None
+        return text_type(agency.agency.eid) if agency.agency is not None else None
 
     def archive_unit_content(self, archive_unit):
         return archive_unit.first_level_choice.content_sequence