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):
|
class ChangedObject(BaseSchema):
|
||||||
obj: ObjectReference
|
obj: ObjectReference
|
||||||
titles: dict[str, str]
|
titles: dict[str, str] | None
|
||||||
created: bool = False
|
created: bool = False
|
||||||
deleted: bool = False
|
deleted: bool = False
|
||||||
fields: FieldValuesDict = {}
|
fields: FieldValuesDict = {}
|
||||||
|
@ -163,7 +163,7 @@ class ChangedObject(BaseSchema):
|
||||||
|
|
||||||
|
|
||||||
class CollectedChanges(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]] = {}
|
prev_values: dict[str, dict[int, FieldValuesDict]] = {}
|
||||||
operations: list[DatabaseOperation] = []
|
operations: list[DatabaseOperation] = []
|
||||||
|
|
||||||
|
|
|
@ -213,6 +213,7 @@ def changeset_detail(request, pk):
|
||||||
if changed_object.titles:
|
if changed_object.titles:
|
||||||
if current_lang in changed_object.titles:
|
if current_lang in changed_object.titles:
|
||||||
title = changed_object.titles[current_lang]
|
title = changed_object.titles[current_lang]
|
||||||
|
else:
|
||||||
title = next(iter(changed_object.titles.values()))
|
title = next(iter(changed_object.titles.values()))
|
||||||
|
|
||||||
changed_object_data = {
|
changed_object_data = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue