misc: remove unused exclude_current_user parameter (#53081)

This commit is contained in:
Frédéric Péters 2021-04-13 17:12:01 +02:00
parent e1c5bffbc2
commit 297806d594
3 changed files with 2 additions and 14 deletions

View File

@ -160,7 +160,6 @@ def email(
replyto=None, replyto=None,
bcc=None, bcc=None,
email_from=None, email_from=None,
exclude_current_user=False,
email_type=None, email_type=None,
want_html=True, want_html=True,
hide_recipients=False, hide_recipients=False,
@ -329,11 +328,6 @@ def email(
if bcc: if bcc:
rcpts += bcc rcpts += bcc
if exclude_current_user:
user = get_request().user
if user and user.email and user.email in rcpts:
rcpts.remove(user.email)
rcpts = [x for x in rcpts if x] rcpts = [x for x in rcpts if x]
if len(rcpts) == 0: if len(rcpts) == 0:
return return

View File

@ -373,9 +373,7 @@ class MethodDirectory(Directory):
} }
try: try:
emails.custom_template_email( emails.custom_template_email('change-password-request', data, user.email)
'change-password-request', data, user.email, exclude_current_user=False
)
except errors.EmailError: except errors.EmailError:
form.set_error('username', _('Failed to send email (server error)')) form.set_error('username', _('Failed to send email (server error)'))
token.remove_self() token.remove_self()
@ -482,9 +480,7 @@ class MethodDirectory(Directory):
'hostname': get_request().get_server(), 'hostname': get_request().get_server(),
} }
emails.custom_template_email( emails.custom_template_email('new-generated-password', data, user.email)
'new-generated-password', data, user.email, exclude_current_user=False
)
return self.forgotten_token_end_page() return self.forgotten_token_end_page()
else: else:

View File

@ -2979,7 +2979,6 @@ class SendmailWorkflowStatusItem(WorkflowStatusItem):
email_rcpt=None, email_rcpt=None,
bcc=addresses, bcc=addresses,
email_from=email_from, email_from=email_from,
exclude_current_user=False,
attachments=attachments, attachments=attachments,
fire_and_forget=True, fire_and_forget=True,
) )
@ -2989,7 +2988,6 @@ class SendmailWorkflowStatusItem(WorkflowStatusItem):
mail_body, mail_body,
email_rcpt=addresses, email_rcpt=addresses,
email_from=email_from, email_from=email_from,
exclude_current_user=False,
attachments=attachments, attachments=attachments,
fire_and_forget=True, fire_and_forget=True,
) )