some bugfixes for titles in changesets
This commit is contained in:
parent
43b9baf03e
commit
e81d3752a7
2 changed files with 4 additions and 3 deletions
|
@ -155,7 +155,7 @@ class ChangedManyToMany(BaseSchema):
|
|||
|
||||
class ChangedObject(BaseSchema):
|
||||
obj: ObjectReference
|
||||
titles: dict[str, str]
|
||||
titles: dict[str, str] | None
|
||||
created: bool = False
|
||||
deleted: bool = False
|
||||
fields: FieldValuesDict = {}
|
||||
|
@ -163,7 +163,7 @@ class ChangedObject(BaseSchema):
|
|||
|
||||
|
||||
class CollectedChanges(BaseSchema):
|
||||
prev_titles: dict[str, dict[int, dict[str, str]]] = {}
|
||||
prev_titles: dict[str, dict[int, dict[str, str] | None]] = {}
|
||||
prev_values: dict[str, dict[int, FieldValuesDict]] = {}
|
||||
operations: list[DatabaseOperation] = []
|
||||
|
||||
|
|
|
@ -213,7 +213,8 @@ def changeset_detail(request, pk):
|
|||
if changed_object.titles:
|
||||
if current_lang in changed_object.titles:
|
||||
title = changed_object.titles[current_lang]
|
||||
title = next(iter(changed_object.titles.values()))
|
||||
else:
|
||||
title = next(iter(changed_object.titles.values()))
|
||||
|
||||
changed_object_data = {
|
||||
'model': model,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue