diff --git a/apps/common/serializers/fields.py b/apps/common/serializers/fields.py index ecf97a0b3..4be566ab1 100644 --- a/apps/common/serializers/fields.py +++ b/apps/common/serializers/fields.py @@ -122,11 +122,17 @@ class LabelRelatedField(serializers.RelatedField): from labels.models import LabeledResource, Label if data is None: return data - if isinstance(data, dict): + if isinstance(data, dict) and data.get("id"): pk = data.get("id") or data.get("pk") label = Label.objects.get(pk=pk) else: - k, v = data.split(":", 1) + if isinstance(data, dict): + k = data.get("name") + v = data.get("value") + elif isinstance(data, str) and ":" in data: + k, v = data.split(":", 1) + else: + raise serializers.ValidationError(_("Invalid data type")) label, __ = Label.objects.get_or_create(name=k, value=v, defaults={'name': k, 'value': v}) return LabeledResource(label=label) diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 28dcd7aa9..370fc07c2 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -408,7 +408,7 @@ "Disable": "Disable", "DisableSelected": "Disable selected", "DisplayName": "Name", - "Docs": "Document", + "Docs": "Docs", "Download": "Download", "DownloadCenter": "Download", "DownloadFTPFileTip": "The current action does not record files, or the file size exceeds the threshold (default 100m), or it has not yet been saved to the corresponding storage", diff --git a/apps/static/img/logo_text_white.svg b/apps/static/img/logo_text_white.svg new file mode 100644 index 000000000..1766770ad --- /dev/null +++ b/apps/static/img/logo_text_white.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file