Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Merge requests
!69
Feature/comp 257 send email on signup
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Feature/comp 257 send email on signup
feature/COMP-257-Send-Email-On-Signup
into
develop
Overview
4
Commits
7
Pipelines
0
Changes
1
2 unresolved threads
Hide all comments
Merged
Bjarke Madsen
requested to merge
feature/COMP-257-Send-Email-On-Signup
into
develop
1 year ago
Overview
4
Commits
7
Pipelines
0
Changes
1
2 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Viewing commit
5540964a
Prev
Next
Show latest version
1 file
+
2
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
5540964a
Remove redundant error checks and add empty contents check
· 5540964a
Bjarke Madsen
authored
1 year ago
compendium_v2/email/__init__.py
+
2
−
8
Options
@@ -29,14 +29,8 @@ def send_mail(
logger
.
warning
(
'
No mail configuration, cannot send email.
'
)
return
if
not
isinstance
(
contents
,
str
):
raise
ValueError
(
'
Contents must be a string.
'
)
if
not
isinstance
(
subject
,
str
):
raise
ValueError
(
'
Subject must be a string.
'
)
if
not
isinstance
(
recipients
,
(
str
,
Sequence
)):
raise
ValueError
(
'
Recipients must be a string or a sequence of strings.
'
)
if
not
contents
or
not
isinstance
(
contents
,
str
):
raise
ValueError
(
'
Contents must be a non-empty string.
'
)
excluded_admins
=
set
(
email
.
lower
()
for
email
in
current_app
.
config
[
'
MAIL_EXCLUDED_ADMINS
'
])
Loading