mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
B: Fix cache after changing aliases
This commit is contained in:
parent
c18efc93e1
commit
bc166b962e
|
@ -363,6 +363,8 @@ class RSForm:
|
|||
for cst in self.cache.constituents:
|
||||
if cst.apply_mapping(mapping, change_aliases):
|
||||
update_list.append(cst)
|
||||
if change_aliases:
|
||||
self.cache.reset_aliases()
|
||||
Constituenta.objects.bulk_update(update_list, ['alias', 'definition_formal', 'term_raw', 'definition_raw'])
|
||||
self.save(update_fields=['time_update'])
|
||||
|
||||
|
@ -555,6 +557,9 @@ class RSFormCache:
|
|||
if not self.is_loaded:
|
||||
self.reload()
|
||||
|
||||
def reset_aliases(self) -> None:
|
||||
self.by_alias = {cst.alias: cst for cst in self.constituents}
|
||||
|
||||
def clear(self) -> None:
|
||||
self.constituents = []
|
||||
self.by_id = {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user