From f9655f5eacfad54b1db22e9499683f53f77ea3bd Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 29 Nov 2021 00:17:00 +0100 Subject: [PATCH] fix base message serializer --- InvenTree/common/serializers.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/InvenTree/common/serializers.py b/InvenTree/common/serializers.py index e4fdf46c4c..b1880c4339 100644 --- a/InvenTree/common/serializers.py +++ b/InvenTree/common/serializers.py @@ -98,14 +98,14 @@ class UserSettingsSerializer(SettingsSerializer): ] -class NotificationMessageSerializer(SettingsSerializer): +class NotificationMessageSerializer(InvenTreeModelSerializer): """ Serializer for the InvenTreeUserSetting model """ - target = serializers.SerializerMethodField() + target = serializers.SerializerMethodField(read_only=True) - source = serializers.SerializerMethodField() + source = serializers.SerializerMethodField(read_only=True) user = serializers.PrimaryKeyRelatedField(read_only=True) @@ -117,11 +117,11 @@ class NotificationMessageSerializer(SettingsSerializer): creation = serializers.CharField(read_only=True) - age = serializers.IntegerField() + age = serializers.IntegerField(read_only=True) - age_human = serializers.CharField() + age_human = serializers.CharField(read_only=True) - read = serializers.BooleanField() + read = serializers.BooleanField(read_only=True) def get_target(self, obj): return get_objectreference(obj, 'target_content_type', 'target_object_id')