Clear old custom name formats when database loaded
This commit is contained in:
parent
89592545f3
commit
a216441029
@ -318,6 +318,7 @@ class CLIManager:
|
||||
and self.dbstate.db.get_total() == 0):
|
||||
self.dbstate.db.set_researcher(owner)
|
||||
|
||||
name_displayer.clear_custom_formats()
|
||||
name_displayer.set_name_format(self.dbstate.db.name_formats)
|
||||
fmt_default = config.get('preferences.name-format')
|
||||
name_displayer.set_default_format(fmt_default)
|
||||
|
@ -418,6 +418,11 @@ class NameDisplay:
|
||||
result = raw_data[_FIRSTNAME]
|
||||
return ' '.join(result.split())
|
||||
|
||||
def clear_custom_formats(self):
|
||||
self.name_formats = {num: value
|
||||
for num, value in self.name_formats.items()
|
||||
if num >= 0}
|
||||
|
||||
def set_name_format(self, formats):
|
||||
|
||||
raw_func_dict = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user