22
22
23
23
def get_mail_types (
24
24
enabled_by_default : MAIL_OPTIONS_ = True ,
25
- mandatory : MAIL_OPTIONS_ = True ,
25
+ optional : MAIL_OPTIONS_ = True ,
26
26
) -> List [Tuple [str , str ]]:
27
27
"""
28
28
default="both" returns both, default and non-default mails.
@@ -33,7 +33,7 @@ def filter_mail(mail):
33
33
return (
34
34
enabled_by_default == "both"
35
35
or mail .enabled_by_default is enabled_by_default
36
- ) and (mandatory == "both" or mail .mandatory is mandatory )
36
+ ) and (optional == "both" or mail .optional is optional )
37
37
38
38
return [
39
39
(mail .get_unique_id (), mail .get_name ())
@@ -43,12 +43,12 @@ def filter_mail(mail):
43
43
44
44
45
45
def get_optional_mails () -> List [Tuple [str , str ]]:
46
- return get_mail_types (mandatory = False , enabled_by_default = "both" )
46
+ return get_mail_types (optional = True , enabled_by_default = "both" )
47
47
48
48
49
49
class TapirEmailBase :
50
50
enabled_by_default = True # mails are opt-out by default
51
- mandatory = True # mails are mandatory by default
51
+ optional = False # mails are mandatory by default
52
52
53
53
class Meta :
54
54
abstract = True
@@ -134,7 +134,7 @@ def send_to_share_owner(self, actor: User | None, recipient: ShareOwner):
134
134
135
135
def user_wants_to_or_has_to_receive_mail (self , user : TapirUser ):
136
136
return (self .get_unique_id () in user .optional_mails ) | (
137
- self .get_unique_id () in [x [0 ] for x in get_mail_types (mandatory = True )]
137
+ self .get_unique_id () in [x [0 ] for x in get_mail_types (optional = False )]
138
138
)
139
139
140
140
def send_to_tapir_user (self , actor : User | None , recipient : TapirUser ):
0 commit comments