fix key constraint error

This commit is contained in:
Michael Shamoon 2022-05-07 00:15:58 -07:00
parent a697eb8530
commit 321e0ced2a

View File

@ -515,5 +515,8 @@ class FrontendSettingsViewSerializer(serializers.ModelSerializer):
return instance return instance
def create(self, validated_data): def create(self, validated_data):
frontend_settings = FrontendSettings.objects.update_or_create(**validated_data) frontend_settings = FrontendSettings.objects.update_or_create(
user=validated_data.get("user"),
defaults={"settings": validated_data.get("settings", None)},
)
return frontend_settings return frontend_settings