Added error handling for incorrectly formatted google creds
This commit is contained in:
@@ -157,3 +157,16 @@ def add_to_mailinglist(email: str):
|
||||
)
|
||||
|
||||
send_email(to, subject, body)
|
||||
except ValueError as err:
|
||||
logging.exception("Formatting of google credentials is incorrect")
|
||||
|
||||
if DEPLOY_ENV == "production":
|
||||
to = "ilari.ojakorpi@sahkoinsinoorikilta.fi"
|
||||
subject = "Web error: Failed adding to google groups"
|
||||
body = "Google credential formatted incorretly\nEmail that was not added: {}\n\nAdd user manually to jäsenet groups.".format(
|
||||
email
|
||||
)
|
||||
|
||||
send_email(to, subject, body)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user