Skip to content

Commit

Permalink
Merge branch 'RecipientsBug' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
amorilla committed Apr 24, 2024
2 parents d3abd0d + 35e6f83 commit e368896
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions django_gsuite_email/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def open(self):
new connection was required (True or False) or None if an exception
passed silently.
"""

from django.core.exceptions import ImproperlyConfigured
if not self.current_user:
# first connection
self.current_user = self.gmail_user
Expand All @@ -74,6 +76,10 @@ def open(self):
# Nothing to do if the connection is already open for same delegation
return False

if self.gmail_user is None:
if not self.fail_silently:
raise ImproperlyConfigured('GMAIL_USER mandatory, set it in settings')
return None
try:
if self.connection is None: newConn=True
else: newConn=False
Expand Down

0 comments on commit e368896

Please sign in to comment.