mirror of https://git.48k.eu/ogcp
Fix ogServer deletion from the configuration file
Otherwise, users can not remove from the web a server declared in the deprecated way.async-tree
parent
328ead9168
commit
4f3c66f04a
|
@ -1534,7 +1534,12 @@ def delete_server(server):
|
|||
with open(filename, 'r+') as file:
|
||||
config = json.load(file)
|
||||
|
||||
config['SERVERS'].remove(server_dict)
|
||||
try:
|
||||
config['SERVERS'].remove(server_dict)
|
||||
except (KeyError, ValueError):
|
||||
config.pop('IP')
|
||||
config.pop('PORT')
|
||||
config.pop('API_TOKEN')
|
||||
|
||||
file.seek(0)
|
||||
json.dump(config, file, indent='\t')
|
||||
|
|
Loading…
Reference in New Issue