From a33027dc392b2b142319d6eeb8dc0f6fb0b67423 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 22 Aug 2018 02:28:37 -0400 Subject: [PATCH] Don't error out if the path to the backup setting file doesn't exist. Signed-off-by: Roberto Rosario --- mayan/apps/smart_settings/classes.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mayan/apps/smart_settings/classes.py b/mayan/apps/smart_settings/classes.py index 84f31469eb..a95d2fbf1b 100644 --- a/mayan/apps/smart_settings/classes.py +++ b/mayan/apps/smart_settings/classes.py @@ -112,8 +112,14 @@ class Setting(object): @classmethod def save_configuration(cls, path=settings.CONFIGURATION_FILEPATH): - with open(path, 'w') as file_object: - file_object.write(cls.dump_data()) + try: + with open(path, 'w') as file_object: + file_object.write(cls.dump_data()) + except IOError as exception: + if exception.errno == errno.IONENT: + # The path for the configuration files doesn't exist. + # We can't save the backup file. + pass @classmethod def save_last_known_good(cls):