diff options
-rw-r--r-- | workshop_app/send_mails.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/workshop_app/send_mails.py b/workshop_app/send_mails.py index a53625e..7e37230 100644 --- a/workshop_app/send_mails.py +++ b/workshop_app/send_mails.py @@ -101,12 +101,12 @@ def send_email( request, call_on, Email sending function while registration and booking confirmation. ''' - - with open(path.join(settings.LOG_FOLDER, 'emailconfig.yaml'), 'r') as configfile: - config_dict = yaml.load(configfile) - - logging.config.dictConfig(config_dict) - + try: + with open(path.join(settings.LOG_FOLDER, 'emailconfig.yaml'), 'r') as configfile: + config_dict = yaml.load(configfile) + logging.config.dictConfig(config_dict) + except: + print('File Not Found and Configuration Error') if call_on == "Registration": message = dedent("""\ |