mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #29983 -- Added pathlib.Path support to the file email backend.
This commit is contained in:
committed by
Carlton Gibson
parent
422b875c65
commit
fbbff7f808
@@ -17,9 +17,6 @@ class EmailBackend(ConsoleEmailBackend):
|
||||
self.file_path = file_path
|
||||
else:
|
||||
self.file_path = getattr(settings, 'EMAIL_FILE_PATH', None)
|
||||
# Make sure self.file_path is a string.
|
||||
if not isinstance(self.file_path, str):
|
||||
raise ImproperlyConfigured('Path for saving emails is invalid: %r' % self.file_path)
|
||||
self.file_path = os.path.abspath(self.file_path)
|
||||
try:
|
||||
os.makedirs(self.file_path, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user