From 561e466dd98bff336c2675f82acfc0778ab6172e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 7 Aug 2021 19:09:37 +0100 Subject: [PATCH] Set a default currency if it doesn't exist --- epicyon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epicyon.py b/epicyon.py index 47eae2b10..e99b9581a 100644 --- a/epicyon.py +++ b/epicyon.py @@ -120,7 +120,7 @@ parser.add_argument('--libretranslateApiKey', default=None, help='API key for LibreTranslate service') parser.add_argument('--defaultCurrency', dest='defaultCurrency', type=str, - default="EUR", + default=None, help='Default currency EUR/GBP/USD...') parser.add_argument('-n', '--nickname', dest='nickname', type=str, default=None, @@ -2699,6 +2699,9 @@ if args.registration: setConfigParam(baseDir, 'registration', 'closed') print('New registrations closed') +defaultCurrency = getConfigParam(baseDir, 'defaultCurrency') +if not defaultCurrency: + setConfigParam(baseDir, 'defaultCurrency', 'EUR') if args.defaultCurrency: if args.defaultCurrency == args.defaultCurrency.upper(): setConfigParam(baseDir, 'defaultCurrency', args.defaultCurrency)