mirror of https://gitlab.com/bashrc2/epicyon
Set default currency
parent
b251ceab49
commit
5ad1622bb6
|
@ -119,6 +119,9 @@ parser.add_argument('--libretranslateApiKey',
|
|||
dest='libretranslateApiKey', type=str,
|
||||
default=None,
|
||||
help='API key for LibreTranslate service')
|
||||
parser.add_argument('--defaultCurrency', dest='defaultCurrency', type=str,
|
||||
default="EUR",
|
||||
help='Default currency EUR/GBP/USD...')
|
||||
parser.add_argument('-n', '--nickname', dest='nickname', type=str,
|
||||
default=None,
|
||||
help='Nickname of the account to use')
|
||||
|
@ -2696,6 +2699,11 @@ if args.registration:
|
|||
setConfigParam(baseDir, 'registration', 'closed')
|
||||
print('New registrations closed')
|
||||
|
||||
if args.defaultCurrency:
|
||||
if args.defaultCurrency == args.defaultCurrency.upper():
|
||||
setConfigParam(baseDir, 'defaultCurrency', args.defaultCurrency)
|
||||
print('Default currency set to ' + args.defaultCurrency)
|
||||
|
||||
if __name__ == "__main__":
|
||||
runDaemon(args.maxLikeCount,
|
||||
sharedItemsFederatedDomains,
|
||||
|
|
|
@ -399,9 +399,16 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
|
|||
for symbol, currName in currencies.items():
|
||||
currencyList.append(currName + ' ' + symbol)
|
||||
currencyList.sort()
|
||||
defaultCurrency = getConfigParam(baseDir, 'defaultCurrency')
|
||||
if not defaultCurrency:
|
||||
defaultCurrency = "EUR"
|
||||
for currName in currencyList:
|
||||
if defaultCurrency not in currName:
|
||||
extraFields += ' <option value="' + \
|
||||
currName + '">' + currName + '</option>\n'
|
||||
else:
|
||||
extraFields += ' <option value="' + \
|
||||
currName + '" selected>' + currName + '</option>\n'
|
||||
extraFields += ' </select>\n'
|
||||
|
||||
extraFields += '</div>\n'
|
||||
|
|
Loading…
Reference in New Issue