# HG changeset patch # User Thomas De Schampheleire # Date 1543436548 -3600 # Node ID cf1d1239cd5536fee5e6bb874afd991c97fd3b22 # Parent f4a9f7a7d03008463f0878004763c2ef10aa2005 model: notification: don't round-trip via list if you want a set 'create' in NotificationModel starts from an empty list, appends entries to it, then converts it to a set. You could equally start with a set and add to it, avoiding the final conversion. diff -r f4a9f7a7d030 -r cf1d1239cd55 kallithea/model/notification.py --- a/kallithea/model/notification.py Thu Nov 22 22:27:14 2018 +0100 +++ b/kallithea/model/notification.py Wed Nov 28 21:22:28 2018 +0100 @@ -68,16 +68,15 @@ created_by_obj = User.guess_instance(created_by) - recipients_objs = [] + recipients_objs = set() if recipients: for u in recipients: obj = User.guess_instance(u) if obj is not None: - recipients_objs.append(obj) + recipients_objs.add(obj) else: # TODO: inform user that requested operation couldn't be completed log.error('cannot email unknown user %r', u) - recipients_objs = set(recipients_objs) log.debug('sending notifications %s to %s', type_, recipients_objs )