From 671d75b42f8b6414d6f1feffea4adce98b05987f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 31 May 2021 13:35:01 +0300 Subject: [PATCH 1/2] Fixed assignment in if statement --- cvat/apps/engine/serializers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cvat/apps/engine/serializers.py b/cvat/apps/engine/serializers.py index 4f3495594a7..edb96df4b66 100644 --- a/cvat/apps/engine/serializers.py +++ b/cvat/apps/engine/serializers.py @@ -425,7 +425,8 @@ def update(self, instance, validated_data): instance.label_set.all().delete() else: for old_label in instance.project.label_set.all(): - if new_label_for_name := list(filter(lambda x: x.get('id', None) == old_label.id, labels)): + new_label_for_name = list(filter(lambda x: x.get('id', None) == old_label.id, labels)) + if len(new_label_for_name): old_label.name = new_label_for_name[0].get('name', old_label.name) try: new_label = project.label_set.filter(name=old_label.name).first() @@ -458,7 +459,8 @@ def validate(self, attrs): new_label_names = set() old_labels = self.instance.project.label_set.all() if self.instance.project_id else self.instance.label_set.all() for old_label in old_labels: - if len(new_labels := tuple(filter(lambda x: x.get('id') == old_label.id, attrs.get('label_set', [])))): + new_labels = tuple(filter(lambda x: x.get('id') == old_label.id, attrs.get('label_set', []))) + if len(new_labels): new_label_names.add(new_labels[0].get('name', old_label.name)) else: new_label_names.add(old_label.name) From f63b864b6560c8c0b334db5afed49e699760a1b6 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinin Date: Mon, 31 May 2021 13:37:57 +0300 Subject: [PATCH 2/2] Added CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd0049d15ba..fb9c48d37ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Project page requests took a long time and did many DB queries () +- Fixed Python 3.6 support () ### Security