# HG changeset patch # User Aurelien Campeas # Date 1234359835 -3600 # Node ID 77779cca6be61529c9688d0c27b4574f982268f9 # Parent 86628c5641440e340548891d41ef08f9a41b2a78 [forms] simplify this test diff -r 86628c564144 -r 77779cca6be6 web/views/baseforms.py --- a/web/views/baseforms.py Wed Feb 11 14:37:06 2009 +0100 +++ b/web/views/baseforms.py Wed Feb 11 14:43:55 2009 +0100 @@ -392,10 +392,8 @@ if rschema != 'eid'] def relations_form(self, entity, kwargs): - pendings = list(self.restore_pending_inserts(entity)) - relations_table = list(self.relations_table(entity)) srels_by_cat = entity.srelations_by_category(('generic', 'metadata'), 'add') - if not pendings and not relations_table and not srels_by_cat: + if not srels_by_cat: return u'' req = self.req _ = self.req._ @@ -406,7 +404,7 @@ w(u'
') w(u'%s' % label) w(u'') - for row in relations_table: + for row in self.relations_table(entity): # already linked entities if row[2]: w(u'' % row[0].display_name(req, row[1])) @@ -420,6 +418,7 @@ w(u'') w(u'') w(u'') + pendings = list(self.restore_pending_inserts(entity)) if not pendings: w(u'') else:
%s