comparison rhodecode/model/notification.py @ 3625:260a7a01b054 beta

follow Python conventions for boolean values True and False might be singletons and the "default" values for "boolean" expressions, but "all" values in Python has a boolean value and should be evaluated as such. Checking with 'is True' and 'is False' is thus confusing, error prone and unnessarily complex. If we anywhere rely and nullable boolean fields from the database layer and don't want the null value to be treated as False then we should check explicitly for null with 'is None'.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 28 Mar 2013 01:10:45 +0100
parents cf665eb84d4c
children ec6354949623
comparison
equal deleted inserted replaced
3624:4dddb7ee8865 3625:260a7a01b054
98 notif = Notification.create( 98 notif = Notification.create(
99 created_by=created_by_obj, subject=subject, 99 created_by=created_by_obj, subject=subject,
100 body=body, recipients=recipients_objs, type_=type_ 100 body=body, recipients=recipients_objs, type_=type_
101 ) 101 )
102 102
103 if with_email is False: 103 if not with_email:
104 return notif 104 return notif
105 105
106 #don't send email to person who created this comment 106 #don't send email to person who created this comment
107 rec_objs = set(recipients_objs).difference(set([created_by_obj])) 107 rec_objs = set(recipients_objs).difference(set([created_by_obj]))
108 108